编程语言
首页 > 编程语言> > 通过EWS托管API C#访问资源日历

通过EWS托管API C#访问资源日历

作者:互联网

我正在使用C#(.NET Framework 4)和Visual Studio 2010 Professional.

我有一个Exchange-Server 2007.在这个服务器上有一个名为de.ffm.parking的资源日历.有一个用户具有相同的名称,但它没有关联的邮箱,所以我无法使用它.

ExchangeService _service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);

_service.Credentials = CredentialCache.DefaultNetworkCredentials;
_service.AutodiscoverUrl("user@suffix.com");

#region Test3   
FolderId te = new FolderId(WellKnownFolderName.Calendar, "de.ffm.parking");

DateTime start = DateTime.Now;
DateTime end = DateTime.Now.AddDays(30);

CalendarView view = new CalendarView(start, end);

foreach (Appointment exchangeAppointment in _service.FindAppointments(te, view))
{
    Console.WriteLine(exchangeAppointment.Subject + "Date: " + exchangeAppointment.Start.ToString());
}
#endregion

所以这段代码给了我一个错误:

The SMTP address has no mailbox associated with it.

您知道如何访问资源日历吗?我的用户拥有访问此日历的权限(每个用户都有).

我的PublicFolder_Root也是空的.

解决方法:

我通过插入邮件地址而不是日历名称解决了这个问题.

标签:c,calendar,exchangewebservices,ews-managed-api,exchange-server-2007
来源: https://codeday.me/bug/20190703/1367600.html