使用 Exchange Web 服务获取日历项目所需的参与者?时间:2019-03-17 标签:c#
我正在尝试使用交换网络服务获得会议所需的与会者。有什么想法吗?我想我需要使用 CalendarItemType,但我不确定如何实现它。 这是到目前为止我的代码:
foreach (var wrk in Workers)
{
TimeWindow timeWindow = new TimeWindow(startDate, endDate);
AvailabilityData requestedData = AvailabilityData.FreeBusy;
List<AttendeeInfo> attendees = new List<AttendeeInfo>();
attendees.Add(new AttendeeInfo(wrk.EmailAddress));
GetUserAvailabilityResults ares = service.GetUserAvailability(attendees, timeWindow, requestedData);
foreach (AttendeeAvailability av in ares.AttendeesAvailability)
{
foreach (CalendarEvent ev in av.CalendarEvents)
{
//get info from each calendarevent
//Possibly use CalendarItemType here?
}
}
}
其中 Workers 是我用姓名和相应电子邮件地址列表创建的类。
I am trying to get the required attendees of a meeting which I got using the exchange web service. Any ideas? I think I need to use CalendarItemType, but I'm not sure how to implement it.
Here is my code so far:
foreach (var wrk in Workers)
{
TimeWindow timeWindow = new TimeWindow(startDate, endDate);
AvailabilityData requestedData = AvailabilityData.FreeBusy;
List<AttendeeInfo> attendees = new List<AttendeeInfo>();
attendees.Add(new AttendeeInfo(wrk.EmailAddress));
GetUserAvailabilityResults ares = service.GetUserAvailability(attendees, timeWindow, requestedData);
foreach (AttendeeAvailability av in ares.AttendeesAvailability)
{
foreach (CalendarEvent ev in av.CalendarEvents)
{
//get info from each calendarevent
//Possibly use CalendarItemType here?
}
}
}
Where Workers is a class I made with a list of names and corresponding email addresses.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过使用
Appointment.Bind
:您可能需要转换在调用
Appointment.Bind
之前将CalendarEvent.Details.StoreId
转换为不同的格式(我不确定这一点),所以如果上面的代码不起作用,您可以尝试添加调用ExchangeService.ConvertId
:You can retrieve the required attendees by binding to the appointment using
Appointment.Bind
:You may have to convert
CalendarEvent.Details.StoreId
to a different format before callingAppointment.Bind
(I am not sure about this), so if the above code is not working you may try adding a call toExchangeService.ConvertId
: