与邮件系统日历数据同步,有如下代码: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,有实现过的指点一下,谢谢!
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,有实现过的指点一下,谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货