问题
I'm trying to learn using EWS API. I want to retrieve all the appointments from my calendar.
I used the following technique to get the appointments:
CalendarFolder folder = CalendarFolder.Bind(service, WellKnownFolderName.Calendar);
CalendarView view = new CalendarView(startDate, endDate);
FindItemsResults<Appointment> results = folder.FindAppointments(view);
Assume that the startDate and endDate are given.
My code keeps crashing at WellKnownFolderName.Calendar
And I get this exception:
'Microsoft.Exchange.WebServices.Data.ServiceResponseException' in Microsoft.Exchange.WebServices.dll
The ErrorCode is 'ErrorImpersonateUserDenied' The Message is The account does not have permission to impersonate the requested user.
But I am trying to access my account only with the EWS API. And I cannot give delegate access to myself from outlook.
Any help is appreciated.
来源:https://stackoverflow.com/questions/32062394/exception-thrown-microsoft-exchange-webservices-data-serviceresponseexception