我正在用C#创建一个应用程序.在此我可以创建一个会议请求,通过代码发送给用户,并出现在Outlook邮件中.
以下代码是我用来发送会议邀请的代码.它工作正常.
StringBuilder OutlookBody = new StringBuilder();
string textvs = @"BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN
VERSION:1.0
BEGIN:VEVENT
LOCATION:" + Location + @"
DTSTART:" + string.Format("DTSTART:{0:yyyyMMddTHHmmssZ}", start) + @"
DTEND:" + string.Format("DTEND:{0:yyyyMMddTHHmmssZ}", end) + @"
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:= " + OutlookBody + @"=0D=0A SUMMARY:" + AppoitmentName + @"
PRIORITY:3
END:VEVENT
END:VCALENDAR";
Run Code Online (Sandbox Code Playgroud)
如何使用相同的代码删除Outlook会议请求.
我也检查了这个答案,但它没有解决我的问题.
我们的一个要求是创建iCalendar文件(.ics)并将它们作为附件发送到电子邮件中.我们使用DDay.Ical.dll创建ics文件,如下所示:
// Create a new iCalendar
iCalendar iCal = new iCalendar();
// Create the event, and add it to the iCalendar
Event evt = iCal.Create<Event>();
// Set information about the event
evt.Start = new iCalDateTime(SomeStartTime);
evt.End = new iCalDateTime(SomeEndTime);
evt.Location = "At so and so place";
evt.Description = "Some Description";
evt.Summary = "About Some Subject";
iCal.Method = "PUBLISH";
// Serialize (save) the iCalendar
iCalendarSerializer serializer = new iCalendarSerializer();
serializer.Serialize(iCal, @"iCalendar.ics");
Run Code Online (Sandbox Code Playgroud)
完整的流程是:
现在,假设,由于任何原因,如果取消约会,则User1创建一个ics文件并将其发送给User2,以便User2可以从本地outlook取消他的事件.
如何创建这样的ics文件?