0
我创建一个C#网站来测试连接是否working.here是我的代码,请大家帮忙:使用asgXmpp连接到我的Openfire服务器故障
protected void Unnamed1_Click(object sender, EventArgs e)
{
XmppClientConnection xmpp;
xmpp = (XmppClientConnection)Application["xmpp"];
if (xmpp == null)
{
xmpp = new XmppClientConnection();
Application["xmpp"] = xmpp;
}
xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
Jid jid = new Jid("[email protected]");
xmpp.AutoPresence = true;
xmpp.AutoResolveConnectServer = true;
xmpp.Port = 5222;
xmpp.UseSSL = false;
xmpp.Server = jid.Server;
xmpp.Username = "[email protected]";
xmpp.Password = "123456";
xmpp.ClientVersion = "1.0";
xmpp.SendMyPresence();
xmpp.Open();
}
void xmpp_OnLogin(object sender)
{
Console.WriteLine();
}
我尝试过很多次,但仍不工作。