Im truy xuất tất cả các cuộc hẹn với EWS cho một phòng cụ thể trong tài khoản Office 365 của tôi. Khi trả lại (các) cuộc hẹn, tài sản của cuộc hẹn có tên của người tổ chức thay vì chủ đề tôi đã đưa ra cuộc hẹn.Khi truy xuất cuộc hẹn với EWS đối tượng chứa tên tổ chức
Tôi đang làm gì sai?
Mã ví dụ cho cách im làm việc đó:
ExchangeService service = new ExchangeService();
service.Credentials = new WebCredentials("username", "password");
service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
DateTime StartDate = DateTime.Today.AddDays(-30);
DateTime EndDate = DateTime.Today.AddDays(60);
CalendarView cv = new CalendarView(StartDate, EndDate);
FolderId CalendarFolderId = new FolderId(WellKnownFolderName.Calendar, "[email protected]");
CalendarFolder calendar = CalendarFolder.Bind(service, CalendarFolderId);
FindItemsResults<Appointment> appointments = calendar.FindAppointments(cv);
foreach (Appointment appointment in appointments.ToList())
{
//this contains the wrong value.....
string subject = appointment.Subject;
//this is correct and has the same value as the incorrect subject
string organizer = appointment.Organizer.Name;
}
này nên được đánh dấu là câu trả lời. cảm ơn! –