【发布时间】:2014-06-10 13:55:40
【问题描述】:
我的邮箱中有多个日历。我只能使用 ews api 2.0 检索一个作为主日历文件夹的日历。现在我想要其中的日历、约会和会议的完整列表。
比如我有三个压光机,一个是主压光机
日历(颜色代码:默认)
约根(颜色代码:粉红色)
Soren(颜色代码:黄色)
我可以使用以下代码检索主“Calnder”的所有值
Folder inbox = Folder.Bind(service, WellKnownFolderName.Calendar);
view.PropertySet = new PropertySet(BasePropertySet.IdOnly);
// This results in a FindItem call to EWS.
FindItemsResults<Item> results = inbox.FindItems(view);
i = 1;
m = results.TotalCount;
if (results.Count() > 0)
{
foreach (var item in results)
{
PropertySet props = new PropertySet(AppointmentSchema.MimeContent,
AppointmentSchema.ParentFolderId, AppointmentSchema.Id,
AppointmentSchema.Categories, AppointmentSchema.Location);
// This results in a GetItem call to EWS.
var email = Appointment.Bind(service, item.Id, props);
string iCalFileName = @"C:\export\appointment" +i ".ics";
// Save as .eml.
using (FileStream fs = new FileStream(iCalFileName, FileMode.Create, FileAccess.Write))
{
fs.Write(email.MimeContent.Content, 0, email.MimeContent.Content.Length);
}
i++;
现在我也想获得所有剩余的日历时间表,但我无法获得。
【问题讨论】:
-
这些日历是委托给您的,还是您拥有?
-
其中一些在我的日历文件夹中并且我拥有它们,一些日历是共享的,需要同时获取拥有和共享的日历
标签: c# asp.net exchangewebservices