[Exchange 2013]创建约会和会议

简介

会议和约会之间的重要区别是,会议有与会者,并且没有约会。约会和会议可以是单实例或属于重复序列,但与会者、 房间或资源中不包括约会,因为它们不需要发送一条消息。在内部,Exchange 使用相同的对象有关的会议和约会。您使用 EWS 托管 API 约会类或 EWS CalendarItem元素来处理与会议和约会。

方法

EWS 托管 API 方法和使用的约会和会议的 EWS 操作。

通过使用EWS托管API创建约会

下面的代码示例演示如何使用 约会对象创建约会、 保存方法,将其保存到日历文件夹,并要验证已创建约会的 Item.Bind方法。

此示例假定您的 Exchange 服务器进行身份验证并已获得命名服务的 ExchangeService对象。

复制代码
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)); 
Console.WriteLine("\nAppointment created: " + item.Subject + "\n"); 
复制代码

在约会对象上设置的属性之后, 保存约会到日历文件夹使用的约会对象 保存方法。

请注意,在验证步骤中,您使用 Id与约会关联的项来验证约会是在日历文件夹中。最佳做法是,将限制到只需要由服务器返回的属性 — — 在这种情况下,约会的主题。

通过EWS托管API创建会议

创建会议,以及将项目保存到日历文件夹中,您通常还想要向与会者发送会议请求。下面的代码示例演示如何创建一个会议并发送会议要求。

此示例假定您的 Exchange 服务器进行身份验证并已获得命名服务的 ExchangeService对象。

复制代码
Appointment meeting = new Appointment(service); 
 
// Set the properties on the meeting object to create the meeting. 
meeting.Subject = "Team building exercise"; 
meeting.Body = "Let's learn to really work as a team and then have lunch!"; 
meeting.Start = DateTime.Now.AddDays(2);             
meeting.End = meeting.Start.AddHours(4); 
meeting.Location = "Conference Room 12"; 
meeting.RequiredAttendees.Add("Mack@contoso.com"); 
meeting.RequiredAttendees.Add("Sadie@contoso.com"); 
meeting.OptionalAttendees.Add("Magdalena@contoso.com"); 
meeting.ReminderMinutesBeforeStart = 60; 
 
// Save the meeting to the Calendar folder and send the meeting request. 
meeting.Save(SendInvitationsMode.SendToAllAndSaveCopy); 
 
// Verify that the meeting was created. 
Item item = Item.Bind(service, meeting.Id, new PropertySet(ItemSchema.Subject)); 
Console.WriteLine("\nMeeting created: " + item.Subject + "\n"); 
复制代码

后在 约会对象上设置的属性,会议对日历文件夹使用保存 保存方法。将 SendInvitationsMode枚举值设置为SendOnlyToAll或SendToAllAndSaveCopy,向与会者发送邀请。

使用 Id与会议相关的项来验证已保存在日历文件夹中。最佳做法是,将限制由服务器返回到只需要的内容--在这种情况下,会议的主题的属性。

总结

调研发起会议,约会的方法。

原文地址

https://msdn.microsoft.com/zh-cn/dn495611

posted @   wolfy  阅读(1840)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
点击右上角即可分享
微信分享提示