.ics文件无法在Apple Mobile的Chrome Mobile中打开

时间:2013-05-14 14:57:03

标签: c# google-chrome mobile icalendar

我收到错误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();

有什么建议吗?

1 个答案:

答案 0 :(得分:4)

我读过的所有内容都说通过Chrome Mobile无法实现。如果你找到答案,我也会感兴趣。

如果有任何帮助,我知道可以通过Safari Mobile获得帮助。答案在这里:

How do you add a link that will add an event to your iPhone calendar from safari?

使用Safari Mobile,解决方案只是链接到.ics文件,但在iOS 5之前甚至不可能使用Safari Mobile。

抱歉,祝你好运!