我正在我的 Web 应用程序中动态创建一个 ical 事件,当有人取消应用程序上的约会时,我们会在他们的电子邮件中生成一个删除 ical 事件 *.ics 文件以删除他们日历中的事件。
创建工作正常,但是当我们尝试删除我们创建的约会时,它并没有从日历中删除它
创建 Ical 事件代码:
string[] contents = {
"BEGIN:VCALENDAR",
"VERSION:2.0",
"PRODID:-//dev.com//iCal//EN",
"X-WR-CALNAME:development",
"X-WR-RELCALID:928C8448-048A-4aa2-BE27-A920773AF3DC",
"X-FUNAMBOL-ALLDAY:0",
"METHOD:REQUEST",
"BEGIN:VEVENT",
"UID:" + Args.EventUID,
"SEQUENCE:1",
"DTSTART:" + Args.EventStartTime.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"),
"DTEND:" + Args.EventEndTime.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"),
"LOCATION: " + Args.EventLocation,
"ORGANIZER: test@outlook.com",
"DESCRIPTION;ENCODING=ESCAPED-CHAR:" + Args.EventName,
"SUMMARY:" + Args.EventDescription,
"STATUS:CONFIRMED",
"TRANSP:OPAQUE",
"PRIORITY:" + Args.EventPriority.ToString(),
"END:VEVENT",
"END:VCALENDAR"
};
创建事件在 iphone/android/outlook 上完美运行
删除事件部分:
string[] contents = {
"BEGIN:VCALENDAR",
"VERSION:2.0",
"METHOD:CANCEL",
"X-WR-CALNAME:development",
"X-WR-RELCALID:928C8448-048A-4aa2-BE27-A920773AF3DC",
"PRODID:-//dev.com//iCal//EN",
"X-FUNAMBOL-ALLDAY:0",
"BEGIN:VEVENT",
"UID:" + Args.EventUID,
"SEQUENCE:2",
"DTSTART:" + Args.EventStartTime.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"),
"DTEND:" + Args.EventEndTime.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"),
"LOCATION: " + Args.EventLocation,
"DESCRIPTION;ENCODING=ESCAPED-CHAR:" + Args.EventName,
"SUMMARY:" + Args.EventDescription,
"ORGANIZER: test@outlook.com",
"PRIORITY:" + Args.EventPriority.ToString(),
"STATUS:CANCELLED",
"TRANSP:OPAQUE",
"END:VEVENT",
"END:VCALENDAR"
};
当我单击生成的此文件以删除已创建的事件时,它不会删除该事件,有时它会复制该事件。
创建和删除的 ical UID 是相同的。