Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
Questionhow to identify rectangles in a bitmap Pin
neodeaths15-Feb-15 4:30
neodeaths15-Feb-15 4:30 
AnswerRe: how to identify rectangles in a bitmap Pin
Afzaal Ahmad Zeeshan15-Feb-15 4:39
professionalAfzaal Ahmad Zeeshan15-Feb-15 4:39 
QuestionA question about "bulk" Pin
Afzaal Ahmad Zeeshan14-Feb-15 22:04
professionalAfzaal Ahmad Zeeshan14-Feb-15 22:04 
AnswerRe: A question about "bulk" Pin
OriginalGriff14-Feb-15 22:26
mveOriginalGriff14-Feb-15 22:26 
AnswerRe: A question about "bulk" Pin
Richard Andrew x6415-Feb-15 1:36
professionalRichard Andrew x6415-Feb-15 1:36 
GeneralRe: A question about "bulk" Pin
Afzaal Ahmad Zeeshan15-Feb-15 2:44
professionalAfzaal Ahmad Zeeshan15-Feb-15 2:44 
GeneralRe: A question about "bulk" Pin
Garth J Lancaster15-Feb-15 20:21
professionalGarth J Lancaster15-Feb-15 20:21 
QuestionGetting TypeInitializationEcxeption for runing Code: Pin
Member 1144974014-Feb-15 2:41
Member 1144974014-Feb-15 2:41 
-->app.config

<configuration>
<configsections>



<vconn>
<XMPP server="gmail.com" connectServer="talk.google.com" username="" password="" />

<startup>
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.5">



--> Configuration access file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;

namespace ConsoleApplication7
{

namespace Config
{
public class Conn:ConfigurationSection
{

[ConfigurationProperty("XMPP")]
public ViniElement XMPP
{
get
{
return (ViniElement)base["XMPP"];
}
}
}

public class ViniElement : ConfigurationElement
{
[ConfigurationProperty("server", IsRequired = true)]
public string Server
{
get
{
return (string)this["server"];
}
}
[ConfigurationProperty("connectServer")]
public string Connserver
{
get
{
return (string)this["connectServer"];
}
}
[ConfigurationProperty("username", IsRequired = true)]
public string userName
{
get
{
return (string)this["username"];
}
}
[ConfigurationProperty("password", IsRequired = false)]
public string Password
{
get
{
return (string)this["password"];
}
}





}
}
}
-->Program.cs for connection to gmail

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Threading.Tasks;
using agsXMPP;
using ConsoleApplication7.Config;

namespace ConsoleApplication7
{
class Program
{


private static Conn vConn = (Conn)ConfigurationManager.GetSection("Vconn");

private static XmppClientConnection Xclient = new XmppClientConnection();


static void Main(string[] args)
{

setUpXmpp();


Console.WriteLine("Waite a Second");




}

private static void setUpXmpp()
{

//Xclient.Server = Conn.VConn.XMPP.Server;
//Xclient.ConnectServer = Conn.VConn.XMPP.Connserver;
//Xclient.Username = Conn.VConn.XMPP.userName;
//Xclient.Password = Conn.VConn.XMPP.Password;
if (Xclient.Username.Length == 0)
{
Console.Write("Please enter the Gmail username : ");
Xclient.ConnectServer = Console.ReadLine();
}
if (Xclient.Password.Length == 0)
{
Console.Write("Please enter the Gmail password for " + Xclient.ConnectServer + ":");
Xclient.Password = Console.ReadLine();
}

try
{
Xclient.Open(Xclient.ConnectServer, Xclient.Password);
Xclient.OnLogin += new ObjectHandler(xmpp_OnLogin);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}

while (true)
{
System.Threading.Thread.Sleep(1000);

}

}
private static void xmpp_OnLogin(object sender)
{
Console.WriteLine("Login succeeded! Listening for connections.");
Console.WriteLine("xmpp Connection State {0}", Xclient.XmppConnectionState);
Console.WriteLine("xmpp Authenticated? {0}", Xclient.Authenticated);

}
}
}

AnswerRe: Getting TypeInitializationEcxeption for runing Code: PinPopular
Dave Kreskowiak14-Feb-15 2:47
mveDave Kreskowiak14-Feb-15 2:47 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
OriginalGriff14-Feb-15 4:01
mveOriginalGriff14-Feb-15 4:01 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
Dave Kreskowiak14-Feb-15 8:13
mveDave Kreskowiak14-Feb-15 8:13 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
Ravi Bhavnani14-Feb-15 16:53
professionalRavi Bhavnani14-Feb-15 16:53 
AnswerRe: Getting TypeInitializationEcxeption for runing Code: Pin
OriginalGriff14-Feb-15 4:01
mveOriginalGriff14-Feb-15 4:01 
AnswerRe: Getting TypeInitializationEcxeption for runing Code: Pin
MortuusI14-Feb-15 6:08
MortuusI14-Feb-15 6:08 
AnswerRe: Getting TypeInitializationEcxeption for runing Code: Pin
Dave Kreskowiak14-Feb-15 8:15
mveDave Kreskowiak14-Feb-15 8:15 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
Member 1144974014-Feb-15 8:26
Member 1144974014-Feb-15 8:26 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
OriginalGriff14-Feb-15 9:32
mveOriginalGriff14-Feb-15 9:32 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
Member 1144974014-Feb-15 8:39
Member 1144974014-Feb-15 8:39 
QuestionHow to install system input language programatically in c# Pin
habib_ashraf14-Feb-15 1:14
habib_ashraf14-Feb-15 1:14 
SuggestionRe: How to install system input language programatically in c# Pin
Richard MacCutchan14-Feb-15 1:51
mveRichard MacCutchan14-Feb-15 1:51 
Question[Solved] Array Issue Pin
Linus Agren14-Feb-15 0:01
Linus Agren14-Feb-15 0:01 
GeneralRe: Array Issue Pin
harold aptroot14-Feb-15 0:14
harold aptroot14-Feb-15 0:14 
AnswerRe: Array Issue Pin
OriginalGriff14-Feb-15 0:42
mveOriginalGriff14-Feb-15 0:42 
GeneralRe: Array Issue Pin
Linus Agren14-Feb-15 1:52
Linus Agren14-Feb-15 1:52 
GeneralRe: Array Issue Pin
OriginalGriff14-Feb-15 2:06
mveOriginalGriff14-Feb-15 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.