我收到错误 102 ():未知文件类型。尝试从 ASP.Net 应用程序下载 .ics 文件时。该文件如下所示:
BEGIN:VCALENDAR
PRODID:-//Test
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
UID:uid
CLASS:PUBLIC
DTSTART:20130506T173000
DTEND:20130506T190000
DESCRIPTION;ENCODING=QUOTED-PRINTABLE: What would you do with an extra $2500?
SUMMARY:Smoking Cessation May
PRIORITY:0
LOCATION:ARMC Theater
END:VEVENT
END:VCALENDAR
我在 C# 中的响应代码是这样的:
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}.ics", "example"));
HttpContext.Current.Response.ContentType = "text/calendar";
HttpContext.Current.Response.Write(calendarData.ToString());
HttpContext.Current.Response.End();
有什么建议么?