如何读取自定义字段值
我正在使用下面的代码使用 ews 从我的收件箱中读取邮件。我可以读取主题等。但是如何读取自定义字段值?
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Credentials = new NetworkCredential("username", "password", "domain");
service.Url = new Uri("https://server/ews/exchange.asmx");
FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, new ItemView(100));
foreach (Item item in findResults.Items)
{
string str=item.Subject;
foreach (ExtendedProperty extendedProperty in item.ExtendedProperties)
{ }
}
我尝试了 item.ExtendedProperties。但计数始终为零。谁能告诉我如何读取自定义字段值?
提前致谢
I am using the below code to read the mails from my inbox using ews. I am able to read Subject etc. But how to read custom field value?
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Credentials = new NetworkCredential("username", "password", "domain");
service.Url = new Uri("https://server/ews/exchange.asmx");
FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, new ItemView(100));
foreach (Item item in findResults.Items)
{
string str=item.Subject;
foreach (ExtendedProperty extendedProperty in item.ExtendedProperties)
{ }
}
I tried item.ExtendedProperties. But the count is always zero. Can any one tell me how to read the custom field value?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据这篇 MSDN 文章,您需要将要检索的扩展属性的属性集添加到 FindItems 方法的 ItemView 参数中。
例如,您的行:
变为:
According to this MSDN article, you need to add a property set for the extended properties that you want to retrieve to the ItemView parameter of the FindItems method.
For example, your line:
becomes: