使用 Lync ContactManager 获取所有联系人
现在我正在使用 LyncClient.ContactManager.BeginSearch 方法来查找联系人。但是,我一直无法弄清楚如何获取所有联系人。我尝试过将“*”和“%”作为通配符传递,但这没有用。现在这是我的函数调用。
_lyncClient.ContactManager.BeginSearch("*", SearchProviders.GlobalAddressList, SearchFields.DisplayName, SearchOptions.ContactsOnly, 400, SearchCallback, "Searching Contacts");
Right now I'm using the the LyncClient.ContactManager.BeginSearch method to find contacts. However, I haven't been able to figure out how to get all the contacts. I've tried passing "*" and "%" as wild-card characters but that has not worked. Right now here is my function call.
_lyncClient.ContactManager.BeginSearch("*", SearchProviders.GlobalAddressList, SearchFields.DisplayName, SearchOptions.ContactsOnly, 400, SearchCallback, "Searching Contacts");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Lync 联系人按组进行组织,因此您需要从组级别开始。获得群组后,您可以枚举其联系人
本文 适合背景和更高级的功能
编辑:具体来说,对于通讯组扩展问题,我认为示例此处 有缺陷。
不要调用 BeginExpand 并等待 WaitHandle,而是提供一个回调方法来处理 Expand 回调。所以,不要:
尝试这个:
这对我来说非常有效。
Lync contacts are organised into groups, so you need to start at the Groups level. Once you've got a group, you can then enumerate through it's Contacts
This article is good for background, and more advanced features
Edit: Specifically, for the distribution groups expansion question, I think the sample here is flawed.
Instead of calling BeginExpand and waiting on the WaitHandle, provide a callback method to handle the Expand callback. So, instead of:
try this:
This works perfectly for me.
我最终进行了多次搜索以获取所有联系人。我浏览字母表中的每个字母来找到它们。加载时间足够快,当它启动时,我只会在网格上显示加载图像一段时间。对于我们拥有的 200 名左右的联系人,这种方法效果很好,但对于 150 名或更少的联系人,我会推荐 Paul 的解决方案。这是我所做的:
I ended up doing multiple searches for now to get all the contacts. I go through each letter of the alphabet to find them. The load time is quick enough and I'll just show a loading image on the grid for a little while when it fires up. This worked well for the 200 or so contacts we have though I would recommend Paul's solution for 150 or less. Here is what I did: