2014-05-20 84 views
0

使用C#,我試圖查詢當天登錄用戶的忙/閒時間,並根據日曆顯示空閒時間列表。 Microsoft提供了以下示例的有限指導:http://msdn.microsoft.com/en-us/library/office/aa494212(v=exchg.140).aspx以編程方式確定日曆可用性

我試圖利用此示例,但我無法使ExchangeServiceBinding(以及其他對象)成爲識別的對象。我已經安裝了EWS託管API 2.0並添加了對Microsoft.Exchange.WebServices(以及對其使用語句)的引用。仍然錯過了上面Microsoft示例中使用的對象的很多引用。有什麼想法嗎?

我沒有結婚這個特別的指南。我的目標非常簡單。我很樂意接受其他方法或建議。

回答

0

您應該創建一個ExchangeService對象。

this.exchangeService = new ExchangeService(ExchangeVersion.YOURVERSION, TimeZoneInfo.FindSystemTimeZoneById("YOURTIMEZONE")); 
this.exchangeService.Credentials = //your credentials, or use impersonation 
this.exchangeService.Url = //exchange server uri; 
this.exchangeService.PreAuthenticate = true; 

在ExchangeService對象上,您應該可以調用GetUserAvailability()。 「

+0

」首先抓住你的老虎「 - 這個問題看起來像一個請求幫助實例化ExchangeService對象,我不確定你是否回答了這個問題。 –

相關問題