與郵件系統日歷資料同步,有如下代碼:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
service.Credentials = new WebCredentials("[email protected]", "Password01!");
service.Url = new Uri("https://mail.ceshi.com/EWS/Exchange.asmx");
Appointment appointment = new Appointment(service);
// Set the properties on the appointment object to create the appointment.
appointment.Subject = "Tennis lesson";
appointment.Body = "Focus on backhand this week.";
appointment.Start = DateTime.Now.AddDays(2);
appointment.End = appointment.Start.AddHours(1);
appointment.Location = "Tennis club";
appointment.ReminderDueBy = DateTime.Now;
// Save the appointment to your calendar.
appointment.Save(SendInvitationsMode.SendToNone);
// Verify that the appointment was created by using the appointment's item ID.
Item item = Item.Bind(service, appointment.Id, new PropertySet(ItemSchema.Subject));
這樣的代碼,資料是同步進了管理員的郵箱賬戶,如果我需要根據不用的用戶來同步資料,是需要分別設定 service的什么屬性。或者Appointment,有實作過的指點一下,謝謝!
uj5u.com熱心網友回復:
Exchange 2013是這個版本的。轉載請註明出處,本文鏈接:https://www.uj5u.com/net/93428.html
標籤:ASP.NET
下一篇:System.TypeLoadException:“未能從程式集“drawtest, Version=1.0.0.0, Culture=neutral, Pub
