【问题标题】:Retrieve Entries from Google Calendar从 Google 日历中检索条目
【发布时间】:2014-02-23 02:49:45
【问题描述】:

我正在开发一个从谷歌日历中检索事件的函数。我已经按照找到的教程实现了它here 该函数确实有效,但最多只能检索 25 个事件,我想知道我是否遗漏了什么。

这是我的职责

void retrieveEvents() 
{
    EventQuery query = new EventQuery();
    CalendarService service = new CalendarService("MyTest");
    service.setUserCredentials("email", "password");
    service.QueryClientLoginToken();

    query.Uri = new Uri("http://www.google.com/calendar/feeds/USER-ID/private/full");

    query.StartTime = new DateTime(2010, 1, 1);
    query.EndTime = DateTime.Now;

    EventFeed calfeed = service.Query(query);

    foreach (EventEntry ee in calfeed.Entries) 
    {
        ListViewItem lvi = new ListViewItem(ee.Title.Text + "\r\n");
        listEvents.Items.Add(lvi);
    }
}

【问题讨论】:

    标签: c# calendar google-calendar-api gdata gdata-api


    【解决方案1】:

    首先,不推荐使用 v2。您确实应该将您的代码升级到使用 API 的 v3。

    来自FAQ

    如何在事件源中检索超过 25 个结果?

    您可以使用查询参数 max-results 来检索超过默认值 25 的数据。如果您希望检索提要中的所有事件,请将 max-results 参数设置为一个非常大的数字。您还可以利用作为提要的子元素提供的下一个链接对事件进行分页。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-12
      • 1970-01-01
      相关资源
      最近更新 更多