gpt4 book ai didi

asp.net-mvc - 谷歌日历无法读取 ICalendar。

转载 作者:行者123 更新时间:2023-12-02 00:13:06 26 4
gpt4 key购买 nike

操作系统:WinXP您用于访问 Google 日历 (FF3.5) 的程序和版本:

我正在开发一个脚本(基于我在网上找到的现有 vCal ASP.NET 类)来生成 .ics 文件。该文件在导入到 Outlook 2003 时工作正常。当我尝试导入到 Google 日历时,出现以下错误:

导入事件失败:无法处理您的 iCal/CSV 文件。

我对 vCal 格式或语法不太了解,但对我来说一切看起来都很好。我将在下面发布示例测试日历 .ics:

BEGIN:VCALENDAR
PRODID:-//jpalm.se//iCalendar example with ASP.NET MVC//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100304T000000Z
DTEND:20100304T000000Z
TRANSP:OPAQUE
SEQUENCE:0
UID:7c9d6dd7-41f2-4171-8ae4-35820974efa4

DESCRIPTION:uba:Project20100321:sagar .

SUMMARY:First Milestone
END:VEVENT
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100330T230000Z
DTEND:20100330T230000Z
TRANSP:OPAQUE
SEQUENCE:0
UID:8a982519-b99b-429a-8dad-c0f95c50d0e6

DESCRIPTION:uba:Project20100321:imanage2010 pm

SUMMARY:upcoming milestones
END:VEVENT
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100329T230000Z
DTEND:20100329T230000Z
TRANSP:OPAQUE
SEQUENCE:0
UID:588750a1-6f10-4b5d-8a51-3f3818024726

DESCRIPTION:uba:Project20100321:sagar .

SUMMARY:test
END:VEVENT
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100407T230000Z
DTEND:20100407T230000Z
TRANSP:OPAQUE
SEQUENCE:0
UID:36eaa726-a0a0-40a1-ba7c-09857f8ed006

DESCRIPTION:uba:Project20100321:imanage2010 pm

SUMMARY:Rad apps devs
END:VEVENT
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100408T125632Z
DTEND:20100408T125632Z
TRANSP:OPAQUE
SEQUENCE:0
UID:8521ad53-916a-43cc-8eeb-42c1b3d670d3

DESCRIPTION:uba:Project20100321:imanage2010 pm

SUMMARY:this is a test ms
END:VEVENT
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100415T125643Z
DTEND:20100415T125643Z
TRANSP:OPAQUE
SEQUENCE:0
UID:e4b295d8-2271-4393-9899-3e9c858f4e8c

DESCRIPTION:uba:Project20100321:imanage2010 pm

SUMMARY:Test msssss
END:VEVENT
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100430T055201Z
DTEND:20100430T055201Z
TRANSP:OPAQUE
SEQUENCE:0
UID:1e464698-1064-4cb2-8166-2a843b63ca5a

DESCRIPTION:uba:Project20100321:imanage2010 pm

SUMMARY:this is a new milestones for testing on 30th april
END:VEVENT
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100731T093917Z
DTEND:20100731T093917Z
TRANSP:OPAQUE
SEQUENCE:0
UID:5262ef58-73bc-4d66-a207-4e884e249629

DESCRIPTION:uba:Project20100321:imanage2010 pm

SUMMARY:555555555555555555
END:VEVENT
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100328T230000Z
DTEND:20100328T230000Z
TRANSP:OPAQUE
SEQUENCE:0
UID:f654262d-714e-41d9-9690-005bb467f8aa

DESCRIPTION:uba:Untitled project:imanage2010 pm

SUMMARY:first milestone
END:VEVENT
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100401T095537Z
DTEND:20100401T095537Z
TRANSP:OPAQUE
SEQUENCE:0
UID:3f4a6c16-f460-457d-a281-b4c010958796

DESCRIPTION:uba:ProjectIcal:imanage2010 pm

SUMMARY:new ms ical
END:VEVENT
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20100331T230000Z
DTEND:20100331T230000Z
TRANSP:OPAQUE
SEQUENCE:0
UID:e5bf28d1-3559-48e9-90f8-2b5233489a13

DESCRIPTION:uba:ProjectIcal:imanage2010 pm

SUMMARY:new ms 2 ical
END:VEVENT
END:VCALENDAR

生成上述代码的来源就是 mvc View ::

<%@ Import Namespace ="iManageProjectPM.Controllers" %>
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<iCalendar>"%>
BEGIN:VCALENDAR
VERSION:2.0<%if (Model.Events.Count > 1)
{%>
CALSCALE:GREGORIAN
METHOD:PUBLISH<%}%>
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
<%foreach(var evnt in Model.Events){%>
BEGIN:VEVENT
DTSTART<%=Model.GetTimeString(evnt.StartTime)%>
DTEND<%=Model.GetTimeString(evnt.EndTime)%>
TRANSP:OPAQUE
SEQUENCE:0
UID:<%=evnt.UID%>
DESCRIPTION:<%=evnt.Desc%>
SUMMARY:<%=evnt.Title%>
END:VEVENT<%}%>
END:VCALENDAR

最佳答案

ical feed 的问题在于,不同的日历对不同的事物有挑剔的态度,而且至少对我来说,规范有点难以遵循。然而,Kanzaki为像我这样的程序员提供了清晰的规范,做得很好。

现在,您的 ical feed 还需要精确到换行符(Apple 的 ical 不会导入末尾带有错误换行符的 feed),我发现这 3 个验证器的组合效果最好:

最严格的验证器实际上对我来说有误报(即,它报告的错误实际上不是根据规范的错误),但发现了一些前两个错误没有的错误,这就是为什么我建议运行您的提要通过他们三个。

关于asp.net-mvc - 谷歌日历无法读取 ICalendar。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2643441/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com