2017-06-14 64 views
0

如何在我進行新的約會後得到回覆?一個好的迴應或不好,它的原因..?響應交換EWS

認證之後,這是我創造的任命

  DateTime bookingStart = new DateTime(2017, 6, 14, 14, 0, 0); 
     DateTime bookingEnd = bookingStart.AddHours(2); 
     Booking booking = new Booking() 
     { 
      Subject = "BookingTest", 
      Start = bookingStart, 
      End = bookingEnd, 
      Room = "[email protected]", 
      Person = "[email protected]" 
     }; 
     //Meetingrequest aanmaken 
     var request = new Appointment(service) 
     { 
      Subject = booking.Subject, 
      Start = booking.Start, 
      End = booking.End, 
      Location = booking.Room 
     }; 
     //Aanhangen wie wilt meedoen 
     request.RequiredAttendees.Add(booking.Person); 
     request.RequiredAttendees.Add(booking.Room); 

     ServiceResponse response = service.CreateItems() 

     request.Save(SendInvitationsMode.SendOnlyToAll); 

代碼但是,這並沒有給我一個對象返回。

回答

0

保存此約會後,會議項目將獲得唯一標識符。

request.Save(SendInvitationsMode.SendOnlyToAll); 
var id = request.Id.UniqueId; 

保存的標識,以後,你可以使用這個標識來追蹤這樣

Appointment meeting = Appointment.Bind(service, new ItemId(id)); 
for (int i = 0; i < meeting.RequiredAttendees.Count; i++) 
{ 
    Console.WriteLine("Required attendee - " + meeting.RequiredAttendees[i].Address + ": " + meeting.RequiredAttendees[i].ResponseType.Value.ToString()); 
} 

參考的會議響應:Tracking meeting responses by using the EWS Managed API 2.0

+0

等待與會者單擊「OK /不OK 」。發送邀請後,您無法運行此_immediately_。 – kennyzx

+0

我工作!謝謝。 – Kaizer

+0

對不起,但我還沒有完成我所需要的。我可以做你說的話,並得到身份證,但是我怎麼能看到房間同時在忙? – Kaizer