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

发布于 2024-08-24 15:02:17 字数 1531 浏览 7 评论 0原文

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

  1. Google 日历 API

    我不知道如何创建“recurData”。 我无法修改字符串并将其作为参数传递。 也尝试过 DDay.iCal 版本 0.80。

  2. DDay.iCal

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

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

出现错误: {“执行请求失败:http ://www.google.com/calendar/feeds/[电子邮件受保护]/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”制作的。

I want to create recurring events of Calendar using Google API.
I am following links:

  1. Google Calendar API

    I am not getting how to create "recurData".
    I can't modify String and pass it as parameter.
    Tried DDay.iCal Version 0.80. also.

  2. DDay.iCal

There are some Example code given.I tried them.
I am able to create ".ics" file.

But when i pass this file content as "recurData"

Getting Error :
{"Execution of request failed: http://www.google.com/calendar/feeds/[email protected]/private/full?gsessionid=AHItK5wrSIoJVawFjGt-0g"}

My icf File content is:

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

I made it using "Example6".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荆棘i 2024-08-31 15:02:17

它认为这个示例会告诉我们,您使用 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;

It think this sample will tell us, that you create your Calendar Entry with the EventEntry Class. Then you pass a recurrence to that entry.

In google's example the DTSTART and DTEND Fields are representing the start and end of the recurrence.

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;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文