Guest User

Untitled

a guest
Jul 27th, 2018
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Use asgXmpp to connect to my openfire server failure
  2. protected void Unnamed1_Click(object sender, EventArgs e)
  3. {
  4. XmppClientConnection xmpp;
  5.  
  6.  
  7. xmpp = (XmppClientConnection)Application["xmpp"];
  8. if (xmpp == null)
  9. {
  10. xmpp = new XmppClientConnection();
  11. Application["xmpp"] = xmpp;
  12. }
  13.  
  14. xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
  15. Jid jid = new Jid("ttt@192.168.1.131");
  16. xmpp.AutoPresence = true;
  17. xmpp.AutoResolveConnectServer = true;
  18. xmpp.Port = 5222;
  19. xmpp.UseSSL = false;
  20. xmpp.Server = jid.Server;
  21. xmpp.Username = "test@jh";
  22. xmpp.Password = "123456";
  23. xmpp.ClientVersion = "1.0";
  24. xmpp.SendMyPresence();
  25. xmpp.Open();
  26.  
  27.  
  28.  
  29. }
  30.  
  31. void xmpp_OnLogin(object sender)
  32. {
  33.  
  34. Console.WriteLine();
  35. }
Add Comment
Please, Sign In to add comment