【发布时间】:2013-05-14 14:57:02
【问题描述】:
我收到错误 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();
有什么建议吗?
【问题讨论】:
-
你找到解决办法了吗?
-
我不记得了,我已经不在这家公司了,忘记了发生了什么,对不起!
标签: c# google-chrome mobile icalendar