使用 Exchange 中的 EWS 获取约会和会议Get appointments and meetings by using EWS in Exchange
09/17/2015
本文内容
了解如何使用 Exchange 中的 EWS 托管 API 或 EWS 获取约会和会议。Learn how to get appointments and meetings by using the EWS Managed API or EWS in Exchange.
您可以使用CalendarFolder EWS 托管 API 方法或FindItem ews 操作从 "日历" 文件夹中检索约会和会议。You can retrieve appointments and meetings from a calendar folder by using the CalendarFolder.FindAppointments EWS Managed API method or the FindItem EWS operation.
使用 EWS 托管 API 获取约会Get appointments by using the EWS Managed API
下面的代码示例演示如何使用 EWS 托管 API 检索介于指定开始时间和结束时间之间的用户约会。The following code example shows how to use the EWS Managed API to retrieve a user's appointments that fall between a specified start and end time.
// Initialize values for the start and end times, and the number of appointments to retrieve.
DateTime startDate = DateTime.Now;
DateTime endDate = startDate.AddDays(30);
const int NUM_APPTS = 5;
// Initialize the calendar folder object with only the folder ID.
CalendarFolder calendar = CalendarFolder.Bind(service, WellKnownFolderName.Calendar, new PropertySet());
// Set the start and end time and number of appointments to retrieve.
CalendarView cView = new CalendarView(startDate, endDate, NUM_APPTS);
// Limit the properties returned