本文介绍了在单个ics文件中分组多个事件(icalendar流)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据RFC将多个事件分组在一个ICS文件(iCalendar流)中.可以做到,但我不知道如何.谁能帮我或给我一个例子吗?

I want to group multiple events in a single ICS file(iCalendar stream) according to the RFC. This can be done but I have no idea how. Can anyone help me or give me an example ?

这是rfc所说的:

 icalstream = 1*icalobject

 icalobject = "BEGIN" ":" "VCALENDAR" CRLF
              icalbody
              "END" ":" "VCALENDAR" CRLF

推荐答案

这是一个带有两个事件的icalendar文件的简单示例.

here is a simple example of an icalendar file with two events.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//bobbin v0.1//NONSGML iCal Writer//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
DTSTART:20100701T080000Z
DTEND:20100701T110000Z
DTSTAMP:20091130T213238Z
UID:[email protected]
CREATED:20091130T213238Z
DESCRIPTION:Example event 1
LAST-MODIFIED:20091130T213238Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Example event 1
TRANSP:OPAQUE
END:VEVENT
BEGIN:VEVENT
DTSTART:20100701T120000Z
DTEND:20100701T130000Z
DTSTAMP:20091130T213238Z
UID:[email protected]
CREATED:20091130T213238Z
DESCRIPTION:Example event 2
LAST-MODIFIED:20091130T213238Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Example event 2
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

将其复制到文件中并另存为events.ics,它应在大多数icalendar兼容应用程序中打开,例如Outlook 2007,Sunbird,iCal.对于更复杂的示例,您可以尝试在Google日历中创建事件并导出日历以查看结果,或者从 icalshare.com .该文件格式类似于电子邮件编码,因为它必须折叠.Wikipedia上有一篇有关ICalendar的不错的文章,如果您使用Google"icalendar验证程序",则可以使用多种服务来验证文件.哦,如果您对此感到沮丧,您不是一个人 http://www.google.co.uk/support/forum/p/Calendar/thread?tid=366b19a87d1304ec&hl=zh_CN 尽管它是一个很好的规范恕我直言,但其实现却非常,嗯,不一样.

Copy this into a file and save it as events.ics and it should open in most icalendar compatible applications e.g. Outlook 2007, Sunbird, iCal. For more complicated examples you could try creating events in Google calendars and exporting the calendars to view the results or downloading preexisting calendars from somewhere like icalshare.com. The file format is similar to e-mail encoding in that it must be folded. Wikipedia has a pretty good article on ICalendar and if you Google "icalendar validator" you there are several services that will let you validate your files. Oh and if you get frustrated with it, you're not alone http://www.google.co.uk/support/forum/p/Calendar/thread?tid=366b19a87d1304ec&hl=en although it is a good spec imho, its implementations are very, er, different.

关于您要如何使用它的更多详细信息将帮助其他人帮助您.

A little more detail on how you want to use it would help others help you.

这篇关于在单个ics文件中分组多个事件(icalendar流)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-21 06:44