public void Register(string uid, string pwd) { RegisterIq riq = new RegisterIq(); riq.Type = IqType.set; riq.To = new Jid(Im.Instance.Xmpp.Server); Register register = new Register(); register.Username = uid; register.Password = pwd; riq.Query.AddChild(register); Im.Instance.Xmpp.IqGrabber.SendIq(riq, OnRegisterResult, null); } private void OnRegisterResult(object sender, IQ iq, object data) {}
不知道为什么注册不了, 点了没反应, 郁闷
调试有什么错误的信息吗?
没,,就点, 没回调
OnRegisterResult 这个方法
不知, 我是不是我的注册方法有误?
根据网上有篇:
private void btnDelAccount_Click(object sender, EventArgs e)
{
agsXMPP.protocol.iq.register.RegisterIq rIq = new agsXMPP.protocol.iq.register.RegisterIq();
rIq.Type = IqType.set;
rIq.To = new Jid(_xmppCon.Server);
rIq.Query.RemoveAccount = true;
MessageBox.Show(rIq.ToString());
_xmppCon.IqGrabber.SendIq(rIq, new IqCB(OnRemoveAccountResult), null);
}
private void OnRemoveAccountResult(object sender, IQ iq, object data)
{
if (iq.Type == IqType.result)
{
// Removed Account Successful
_xmppCon.Close();
MessageBox.Show("成功");
}
else if (iq.Type == IqType.error)
{
MessageBox.Show("失败");
}
}