如何从Lync客户端获取状态 [英] How to get Presence from Lync Client

查看:101
本文介绍了如何从Lync客户端获取状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在PC上运行的程序需要从中获取状态登录用户。
安装了Lync Client,我希望能够从中获得它。


程序在本地运行,并且用VB编码。
D o你有一个示例代码可以帮助我达到这个要求吗?


谢谢 !!


罗德里戈

解决方案

罗德里戈,


我建议的第一件事就是看Lync Client SDK CHM文件,以了解如何以编程方式将当前用户签名到Lync客户端的运行实例。


这涉及创建和设置Microsoft.Lync.Model的实例.LyncClient。然后你要创建一个Microsoft.Lync.Model.Self实例


 

 _ self = _lyncClient .Self; 

 


登录用户的存在可能会多次更改,因此您应该连接ContactInformationChanged事件自我对象。在该事件处理程序中,您可以检查事件args中更改的联系信息,例如:
 


 var contact = sender as Contact; 

if(e.ChangedContactInformation.Contains(ContactInformationType.Activity))
{
var presence = contact.GetContactInformation(ContactInformationType.Activity).ToString());
}


我建议的另一个资源是Lync Developer Kit,你可以在http://下载它www.microsoft.com/downloads/en/details.aspx?FamilyID=85db249e-c555-49f1-b213-a1297130b3e1


Hi, I have a program running in the PC that needs to get presence status from the logged on user. Lync Client is installed and I expect to get presence from it.

The program runs locally and it´s coded in VB.NET. Do you have a sample code that can help me achieve this requirement?

Thanks!!

Rodrigo

解决方案

Rodrigo,

The first thing I would recommend is looking at the Lync Client SDK CHM files to understand how to programmatically sign the current user in to the running instance of the Lync client.

This involves creating and setting up an instance of Microsoft.Lync.Model.LyncClient. Then you're going to create an instance of Microsoft.Lync.Model.Self

 

_self = _lyncClient.Self;

 

The presence of the logged in user might change multiple times, so you should wire up the ContactInformationChanged event of the Self object. In that event handler, you can check for the piece of contact information that changed in the event args, e.g.:  

var contact = sender as Contact;

if (e.ChangedContactInformation.Contains(ContactInformationType.Activity))
{
var presence = contact.GetContactInformation(ContactInformationType.Activity).ToString());
}

Another resource I would recommend is the Lync Developer Kit, you can download that at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=85db249e-c555-49f1-b213-a1297130b3e1


这篇关于如何从Lync客户端获取状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆