문제

I want to get my Vcard from server. I send my Vcard to server by this code:

VcardIq viq = new VcardIq(IqType.set, new Jid(XmppCon.Server));
viq.Vcard.Nickname = "Alex";
XmppCon.Send(viq); 

And I know from this,that how to get other user's Vcard.But this method don't work for my registered Id. Can anyone help me to get my Vcard from server in agsXMPP?

도움이 되었습니까?

해결책

Here is a sample code

public void GetMyVcard()
{
  VcardIq viq = new VcardIq(IqType.get);  
  xmppCon.IqGrabber.SendIq(viq, new IqCB(VcardResult), null);
}

private void VcardResult(object sender, IQ iq, object data)
{
  if (iq.Type == IqType.result)
  {
    Vcard vcard = iq.Vcard;
    if (vcard != null)
    {
      string fullname = vcard.Fullname;
      string nickname = vcard.Nickname;
      string description = vcard.Description;
      Photo photo = vcard.Photo;       
    }
  }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top