我的应用程序使用Lync 2013,通过websocket与服务器通信,并接收通知。
这些通知是Json格式的,所以我将其转换为提取字符串。
字符串是一个电话号码,我想测试我的一个联系人是否是同一个电话号码,以显示他的名字。
我的If总是“false”。
我想使用>然后提取DisplayName的值(电话号码作为字符串),但我不知道怎么做。
这是我的密码。
foreach (var group in client.ContactManager.Groups)
{
foreach (Contact contact in group)
{
List<object> endpoints = (List<object>)contact.GetContactInformation(ContactInformationType.ContactEndpoints);
List<object> phoneNumbers = endpoints.Cast<object>().Where<object>(N => ((ContactEndpoint)N).Type == ContactEndpointType.HomePhone ||
((ContactEndpoint)N).Type == ContactEndpointType.MobilePhone ||
((ContactEndpoint)N).Type == ContactEndpointType.WorkPhone ||
((ContactEndpoint)N).Type == ContactEndpointType.OtherPhone).ToList();
if (phoneNumbers.ToList().Contains(call.caller))
{
MessageBox.Show(contact.GetContactInformation(ContactInformationType.DisplayName).ToString());
}
}
}