Click here to Skip to main content
15,913,153 members
Home / Discussions / C#
   

C#

 
QuestionCan PdfFileWriter Support Chinese? Pin
gzhmrj15-Feb-15 22:23
gzhmrj15-Feb-15 22:23 
AnswerRe: Can PdfFileWriter Support Chinese? Pin
OriginalGriff15-Feb-15 22:26
mveOriginalGriff15-Feb-15 22:26 
Questioni need to convert merge sort algorithm to accept arrays then sort them this is the code I need to modify Pin
Member 1135438615-Feb-15 20:31
Member 1135438615-Feb-15 20:31 
AnswerRe: i need to convert merge sort algorithm to accept arrays then sort them this is the code I need to modify Pin
OriginalGriff15-Feb-15 20:42
mveOriginalGriff15-Feb-15 20:42 
GeneralRe: i need to convert merge sort algorithm to accept arrays then sort them this is the code I need to modify Pin
Member 1135438616-Feb-15 11:44
Member 1135438616-Feb-15 11:44 
GeneralRe: i need to convert merge sort algorithm to accept arrays then sort them this is the code I need to modify Pin
OriginalGriff16-Feb-15 23:24
mveOriginalGriff16-Feb-15 23:24 
QuestionExecute cobol code using c#.net Pin
Member 1144452115-Feb-15 20:04
Member 1144452115-Feb-15 20:04 
AnswerRe: Execute cobol code using c#.net Pin
Garth J Lancaster15-Feb-15 20:19
professionalGarth J Lancaster15-Feb-15 20:19 
AnswerRe: Execute cobol code using c#.net Pin
OriginalGriff15-Feb-15 20:36
mveOriginalGriff15-Feb-15 20:36 
QuestionCan any one give me some hints on how to solve this problem? Pin
Truck5315-Feb-15 5:11
Truck5315-Feb-15 5:11 
AnswerRe: Can any one give me some hints on how to solve this problem? Pin
OriginalGriff15-Feb-15 5:39
mveOriginalGriff15-Feb-15 5:39 
AnswerRe: Can any one give me some hints on how to solve this problem? Pin
Dave Kreskowiak15-Feb-15 17:39
mveDave Kreskowiak15-Feb-15 17:39 
AnswerRe: Can any one give me some hints on how to solve this problem? Pin
phil.o17-Feb-15 3:20
professionalphil.o17-Feb-15 3:20 
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 

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.