update for fetionsdk

     This article  undates for the lastest blog about fetion_friend's portrait downing.

As we all know,we can preview stranger's portrait(photo) when we use the funtion

of addBuddy() in fetion. But maybe you don't know how it works,how it can be realized.

Today,I will tell you how it work,and how it will be achieved.

     It's a amazing thing what I want to do now.Because we can preview stranger's photo

before you add him to be your friend.(This is the point.You know,someone may put his real

photo as his fetion's portrait. Just like this guy.)

Here is the demo link: http://www.humyo.cz/F/9852133-1550241075

or http://files.cnblogs.com/lxiongh/fetionPortraitDemo.rar

stranger's portrait (this guy's real image)

     How it realize? Now I tell me, the code is below:

(The code must be changed to fit your code. Enjoying it. For any questions,contact me.)

IicUri uri ;

Contact contact ;

this .LastContact = null ;

AsyncBizOperation op = new AsyncBizOperation ();

op .IsImpsErrorHandled = true ;

if (isMobileNo )

{

    if (this .textBoxMobileNo .Text .Length != 11 )

    { return ; }

    if (!ImpsHelper .IsCmccMobileNo (this .textBoxMobileNo .Text ))

   {

       this ._frameworkWindow .UnifiedMessageBox .ShowWarning (this , StringTable .Contact .InvalidMobileNo );

       return ;

   }

   uri = IicUri .CreateTelUri (this .textBoxMobileNo .Text .Trim ());

   contact = this ._user .ContactList .FindContactByMsisdnEx (uri .MobileNo );

 

   if (contact == null )

   {

      contact = this ._user .ContactList .FindOrCreateContact (uri .Raw , op );

   }

   else if ((contact .BelongToGroups .Count >= 1 ) && !this ._initTargetGroupId .HasValue )

   {

     this ._initTargetGroupId = new int ? (contact .BelongToGroups [0 ]); this .initGroup ();

   }

}

else

{

    if (this .textBoxSID .Text .Length < 3 ) { return ; } long sid = Convert .ToInt64 (this .textBoxSID .Text .Trim ());

    uri = IicUri .CreateSidUri (sid ); contact = this ._user .ContactList .FindContact (uri .Raw );

    if (contact == null ) { this ._user .ContactList .AsyncGetUri (sid , op );

    op .Successed += new EventHandler (this .op_GetUriSuccessed ); }
    else if ((contact .BelongToGroups .Count >= 1 ) && !this ._initTargetGroupId .HasValue )

    {

         this ._initTargetGroupId = new int ? (contact .BelongToGroups [0 ]); this .initGroup ();

    }

}

if (contact != null )

{

     this ._user .ContactList .AsyncGetContactsInfo (contact , new AsyncBizOperation (), null , false , new string []

     { "nickname" , "provisioning" , "portrait-crc" , "user-id" }

);

this .LastContact = contact ;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值