public static void Main(string[] args) { GaduServer gaduServer = new GaduServer("91.197.13.26", 8074); gadu = new Gadu(); gadu.Reciever.OnLoginOK += new OnLoginOKHandler(loginok); gadu.Reciever.OnLoginFailed += new OnLoginFailedHandler(loginfailed); gadu.Reciever.OnRecieveMessage += new OnRecieveMessageHandler(RecvMsg); gadu.Reciever.OnRecieveMessageAck += new OnRecieveMessageAckHandler(MsgAck); gadu.Sender.OnPacketSent += new OnPacketSentHandler(packet); gadu.Connect(gaduServer); gadu.Login(179824, "password"); while (!exit) { System.Threading.Thread.Sleep(1000); } Console.WriteLine("Koncze dzialanie"); gadu.Logout(); gadu.Disconnect(); }
private static void Disconnect() { Console.WriteLine("Disconnecting..."); try { gadu.Logout(); } catch (Exception e) { Console.WriteLine("E: " + e.Message); Console.WriteLine("E: " + e.StackTrace); } finally { gadu.Disconnect(); gadu = null; } }
public static void Main(string[] args) { GaduServer gaduServer = new GaduServer("91.197.13.26", 8074); Gadu gadu = new Gadu(); gadu.Reciever.OnLoginOK += new OnLoginOKHandler(loginok); gadu.Reciever.OnLoginFailed += new OnLoginFailedHandler(loginfailed); gadu.Reciever.OnLoginNeedEmail += new OnLoginNeedEmailHandler(loginneedemail); gadu.Sender.OnPacketSent += new OnPacketSentHandler(packet); gadu.Connect(gaduServer); gadu.Login(179824, "password"); System.Threading.Thread.Sleep(5000); gadu.Logout(); gadu.Disconnect(); }