Csharp/C#教程:如何在Google日历中创建“recurData”?分享


如何在Google日历中创建“recurData”?

我想使用Google API创建日历的定期事件。 我正在关注链接:

  1. Google Calendar API

    我没有得到如何创建“recurData”。 我无法修改String并将其作为参数传递。 尝试过DDay.iCal版本0.80。 也。

  2. DDay.iCal

给出了一些示例代码。我尝试了它们。 我能够创建“.ics”文件。

但是当我将此文件内容作为“recurData”传递时

出错:{“执行请求失败: http : //www.google.com/calendar/feeds/user@domain.com/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”制作了它。

它认为此示例将告诉我们您使用EventEntry类创建日历条目。 然后将重复传递给该条目。

在Google的示例中,DTSTART和DTEND字段表示重复的开始和结束。

上述就是C#学习教程:如何在Google日历中创建“recurData”?分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

 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:20070501rn" + "DTEND;VALUE=DATE:20070502rn" + "RRULE:FREQ=WEEKLY;BYDAY=Tu;UNTIL=20070904rn"; Recurrence recurrence = new Recurrence(); recurrence.Value = recurData; myEntry.Recurrence = recurrence; 

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/cdevelopment/949639.html

(0)
上一篇 2021年11月17日
下一篇 2021年11月17日

精彩推荐