【发布时间】:2023-03-20 00:52:01
【问题描述】:
美好的一天。
我正在使用 EWS Managed Api 2.0 在我的 .NET 4.0 应用程序中获取 Exchange 2013 联系人。
我有一个有效的交换服务器绑定。这是我的代码。
FolderId foldid = new FolderId(WellKnownFolderName.Contacts);
ContactsFolder contactfolder = ContactsFolder.Bind(exservice, foldid);
ItemView view = new ItemView(500);
view.PropertySet = new PropertySet(BasePropertySet.IdOnly);
// Request the items in the Contacts folder that have the properties that you selected.
FindItemsResults<Item> contactItems = exservice.FindItems(foldid, view);
// Display the list of contacts. (Note that there can be a large number of contacts in the Contacts folder.)
foreach (Item item in contactItems)
{
if (item is Contact)
{
Contact contact = item as Contact;
}
}
但是当我运行代码时,contactItems 返回 0。这很奇怪,因为我们在 Exchange 2013 中有联系人。(Itemcount = 0,TotalCount = 0)
EWS Managed API Contact is 0 Image
我该如何解决这个问题? 我已将此问题发布到 Microsoft 技术问题中,但尚未有人回复。
非常感谢。
【问题讨论】:
标签: api exchange-server exchangewebservices managed