问题描述
我有一个与交换同步并获取给定itemid的emailmessage对象的代码:
I have a code which synchronizes with exchange and gets the emailmessage objects for the given itemids:
List<EmailMessage> emails = new List<EmailMessage>();
ServiceResponseCollection<GetItemResponse> response =
MyExchangeService.BindToItems(MyItemIds, PropertySet);
foreach (GetItemResponse getItemResponse in response)
{
if (getItemResponse.Item != null)
{
emails.Add((EmailMessage)getItemResponse.Item);
}
}
现在,作为结果得到的emailmessage
对象包含DateTimeReceived
属性作为9/15/2017 5:27:16 AM
,而我希望它也包含时间的毫秒部分.是否有可能?
Now, the emailmessage
object that I get as a result, contains the DateTimeReceived
property as 9/15/2017 5:27:16 AM
whereas I would like it to contain the millisecond part of the time as well. Is it possible?
推荐答案
您需要在ExchangeService类上设置精度,请参见 https://msdn.microsoft.com/zh-CN/library/microsoft.exchange.webservices.data .exchangeservice.datetimeprecision(v = exchg.80).aspx 到拨打电话之前的毫秒数
You need to set the precision on the ExchangeService class see https://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.exchangeservice.datetimeprecision(v=exchg.80).aspx to millisecond before you make the call
这篇关于如何使用EWS托管API获取电子邮件消息的DateTimeRecieved字段的毫秒部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!