2010-03-09 198 views
6

我想使用Google API創建日曆的週期性事件。 我下面的鏈接:如何在Google日曆中創建「recurData」?

  1. Google Calendar API

    我沒有得到如何創建 「recurData」。 我無法修改字符串並將其作爲參數傳遞。 嘗試DDay.iCal版本0.80。也。

  2. DDay.iCal

還有一些實施例代碼given.I嘗試過它們。 我可以創建「.ics」文件。

但是當我通過這個文件,內容爲 「recurData」

四處錯誤: { 「的要求執行失敗:http://www.google.com/calendar/feeds/[email protected]/private/full?gsessionid=AHItK5wrSIoJVawFjGt-0g」}

我的ICF文件內容是:

BEGIN:VCALENDAR 
VERSION:2.0 
PRODID:-//DDay.iCal//NONSGML ddaysoftware.com//EN 
BEGIN:VEVENT 
CREATED:20100309T132930Z 
DESCRIPTION:The event description 
DTEND:20100310T020000 
DTSTAMP:20100309T132930Z 
DTSTART:20100309T080000 
LOCATION:Event location 
SEQUENCE:0 
SUMMARY:18 hour event summary 
UID:396c6b22-277f-4496-bbe1-d3692dc1b223 
END:VEVENT 
BEGIN:VEVENT 
CREATED:20100309T132930Z 
DTEND;VALUE=DATE:20100315 
DTSTAMP:20100309T132930Z 
DTSTART;VALUE=DATE:20100314 
SEQUENCE:0 
SUMMARY:All-day event 
UID:ac25cdaf-4e95-49ad-a770-f04f3afc1a2f 
END:VEVENT 
END:VCALENDAR 

我是用「Example6」製作的。

回答

2

它認爲這個示例會告訴我們,您使用EventEntry類創建日曆條目。然後,您將重複發送到該條目。

在谷歌的例子中,DTSTART和DTEND字段代表重現的開始和結束。

EventEntry myEntry = new EventEntry(); 
myEntry.Title.Text = "Hello recurring Event!"; 
// Set a location for the event. 
Where eventLocation = new Where(); 
eventLocation.ValueString = "here and there"; 
entry.Locations.Add(eventLocation); 

// Any other event properties 

// Recurring event: 
String recurData = 
    "DTSTART;VALUE=DATE:20070501\r\n" + 
    "DTEND;VALUE=DATE:20070502\r\n" + 
    "RRULE:FREQ=WEEKLY;BYDAY=Tu;UNTIL=20070904\r\n"; 

Recurrence recurrence = new Recurrence(); 
recurrence.Value = recurData; 
myEntry.Recurrence = recurrence;