如何使用day . ical生成Organizer字段

本文关键字:Organizer 字段 生成 ical 何使用 day | 更新日期: 2023-09-27 18:09:08

我正在使用c#库DDay。iCal并尝试生成IETF RFC 2445中定义的ORGANIZER字段:

ORGANIZER;CN=John Smith:MAILTO:jsmith@host1.com

一个简单的问题:我该怎么做?我已经尝试了几种替代方案,但都不成功:结果总是有问题。

如何使用day . ical生成Organizer字段

我自己回答。在更仔细地研究RFC 2445(或5545)之后,这一点非常明显:

iCalendar iCal = new iCalendar();
Event ev = iCal.Create<Event>();
ev.Organizer = new Organizer("MAILTO:jsmith@host1.com");
ev.Organizer.CommonName = "John Smith";

好的,结果并不完全相同:

ORGANIZER;CN="John Smith":MAILTO:jsmith@host1.com

但是,MS Outlook接受这种格式,而这正是我想要的。