FetionSDK加载飞信图像

 

这是09年时的成果,现在FetionSDK.dll已经不能使用。

——————————————————————————————————————————

// 加载飞信好友的图像 Portrait ( 它属于 Contact.ContactInfo.Portrait)

首先要得到一个有效的 Contact 实例

其次增加 Contact.ContactInfo. PropertiesChanged 事件

最后在事件代码里完成图片的下载

基本代码如下 :

IicUri uri = Uri.CreatUri(string MobileNo);
Contact contact = sdk.AccountManager.CurrentUser.ContactList.FindFindContactByMsisdnEx(uri.MobileNo);
If(contact==null)
{
         AsyncBizOperation op = new AsyncBizOperation();
         contact = sdk.AccountManager.CurrentUser.ContactList.FindOrCreateContact(uri.Raw, op);
}
// 添加事件
contact.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(PersonalInfo_PropertiesChanged);
void PersonalInfo_PropertiesChanged(object sender, PropertiesChangedEventArgs e)
{
         // 这里应该是一个循环 , 等返回为 True 时才表示图像下载完毕
    while (!e.ContainsAnyOfProperties(new string[] { "nickname", "Provision", "Portrait" })){}
    pictureBox1.Image = ((ContactInfo)sender).Portrait; 
}
//最近几天发了有关基于FetionSDK.dll飞信开发的一些代码,都是比较凌乱,没有有机的组织在一起,但这
//都是一些基本的模块,若以后有时间我会将所有的代码组织一下,再发到博客上,敬请关注!

 

 

 

 

 

转载于:https://www.cnblogs.com/lxiongh/archive/2009/09/15/2742541.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值