java exchange 日历_如何通过EWS-API 获取所有会议室的日历信息

///

/// 获取用户在某段时间内的所有会议。最长时间间隔为42天。

///

/// 要查询的开始时间。

/// 要查询的结束时间

/// 要查询的邮箱日历,如果查询当前登录的用户的日历,可不填。

/// 返回一个会议列表。列表对象不包含详细信息(如接受拒绝状态等),需使用 方法获取。

public List GetMeetings(DateTime startDate, DateTime endDate, string mailbox = null)

{

CalendarFolder calendar = null;

if (mailbox == null)

{

calendar = CalendarFolder.Bind(Service, WellKnownFolderName.Calendar);

}

else

{

FolderId folderid = new FolderId(WellKnownFolderName.Calendar, mailbox);

calendar = CalendarFolder.Bind(Service, folderid);

}

// Set the start and end time and number of appointments to retrieve.

CalendarView cView = new CalendarView(startDate, endDate);

// Limit the properties returned to the appointment's subject, start time, and end time.

cView.PropertySet = new PropertySet(AppointmentSchema.Subject,

AppointmentSchema.LastModifiedTime,

AppointmentSchema.IsMeeting,

AppointmentSchema.Start,

AppointmentSchema.End);

// Retrieve a collection of appointments by using the calendar view.

FindItemsResults appointments = calendar.FindAppointments(cView);

return appointments.Where(m => m.IsMeeting).ToList();

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值