gpt4 book ai didi

exchangewebservices - 在列表属性上使用SearchFilter

转载 作者:行者123 更新时间:2023-12-04 08:04:54 25 4
gpt4 key购买 nike

我目前在Outlook 2010上使用EWS。我正在尝试根据“类别”字段查找用户的联系人。我本质上是想返回其类别字段包含特定子字符串的每个联系人。下面是一个示例:

ExchangeService service = new ExchangeService
{
Credentials = new WebCredentials(user, password, domain),
Url = new Uri(exchangeUrl),
};
string searchString = "abc";
SearchFilter filter = new SearchFilter.ContainsSubstring(ItemSchema.Categories, searchString);
ItemView view = new ItemView(200);
Mailbox mailbox = new Mailbox("blah@blah.com");
FolderId folderId = new FolderId(WellKnownFolderName.Contacts, mailbox);
FindItemsResults<Item> results = service.FindItems(folderId, filter, view);


这当然会失败,因为类别字段现在令人讨厌地是 StringList而不是普通字符串。我们所有的用户联系人仅具有1个与之关联的类别。是否可以通过仅在第一个类别上运行比较来使此 SearchFilter工作?

请注意:由于我无法控制的原因,我 cannot use AQS strings。他们根本不是一个选择。我必须使用 SearchFilter对象(或其他某种机制来过滤结果)。

最佳答案

从我所看到的,您必须使用AQSExact Match。如果您不能使用其中任何一种,那么对于包含实现,总是使用using ItemView and paging through all messages category properties的蛮力方法。

关于exchangewebservices - 在列表属性上使用SearchFilter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11019314/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com