1
我有一小段代码连接到Exchange以获取特定帐户的约会。此帐户没有邮箱。无法通过邮箱获取Exchange帐户的约会
Dim service As New ExchangeService(ExchangeVersion.Exchange2010_SP2)
service.Credentials = New NetworkCredential("userID", "password")
service.AutodiscoverUrl("[email protected]")
Dim calView As New CalendarView(DateTime.Today, DateTime.Today.AddYears(2))
calView.Traversal = ItemTraversal.Shallow
calView.PropertySet = New PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.Subject, AppointmentSchema.Location)
Dim mtgs As FindItemsResults(Of Item) = service.FindItems(WellKnownFolderName.Calendar, calView)
该代码在最后一行提出以下例外。
当作为没有邮箱的帐户发出请求时,必须为任何独立文件夹ID指定邮箱主SMTP地址。
我已经使用service.UseDefaultCredentials = True代替了Credentials行来执行代码,并且它执行但当然会返回我的约会。有没有解决这个问题?我认为我的选择是说服Exchange管理员为感兴趣的账户授予我的账户模拟权限。
考虑发布您的答案,作为答案。它会帮助其他用户。 – Idris
谢谢,@颜色。 – Bashzilla