是否可以通过EWS获取用户的时区和工作时间?
我能够提取当前用户的 TZ 和工作时间(初始化 ExchangeService 的帐户)
UserConfiguration usrConfig = UserConfiguration.Bind(service, "WorkHours", WellKnownFolderName.Calendar, UserConfigurationProperties.All);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(new MemoryStream(usrConfig.XmlData));
XmlNodeList nlList = xmlDoc.GetElementsByTagName("WorkHoursVersion1");
Console.WriteLine(nlList.Item(0).InnerXml);
string str = nlList.Item(0).InnerXml;
但我无法为其他用户提取相同的信息。
我用获取用户可用性 http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.exchangeservice.getuseravailability%28v=exchg.80%29.aspx手术。
输入是用户数组。输出包括一个与会者可用性数组 http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.getuseravailabilityresults.attendeesavailability%28v=exchg.80%29.aspx,其中包含一个工作时间 http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.workinghours%28v=exchg.80%29.aspx属性,它本身包括时区:
GetUserAvailabilityResults uars = service.GetUserAvailability(
new AttendeeInfo[] { new AttendeeInfo(smtpAddressOfUser, MeetingAttendeeType.Required, true), ... },
new TimeWindow(DateTime.Now, DateTime.Now.AddDays(1)),
AvailabilityData.FreeBusy
);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)