EWS托管API获取电子邮件消息的DateTimeRecieve

EWS托管API获取电子邮件消息的DateTimeRecieve

本文介绍了如何使用EWS托管API获取电子邮件消息的DateTimeRecieved字段的毫秒部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个与交换同步并获取给定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字段的毫秒部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 12:37