c# - 与谷歌日历双向同步

标签 c# google-calendar-api

你们知道 Google 日历是否有任何类型的“推送”服务吗?有没有办法获取自特定时间戳以来用户日历的所有更改?

最佳答案

如果您使用 Updated-min = lastsynctime,您将获得正确的新的、更新的、已删除的事件。

 string formatedDate = "";
        EventQuery query = new EventQuery();
        DateTime? time;
        if (!string.IsNullOrEmpty(startDate))
        {
            time = Convert.ToDateTime(startDate);
            formatedDate = string.Format("{0:s}", time);

            // Create the query object:
            query.Uri = new Uri("http://www.google.com/calendar/feeds/" + service.Credentials.Username + "/private/full?updated-min=" + formatedDate);
        }
        else
        {
            query.Uri = new Uri("http://www.google.com/calendar/feeds/" + service.Credentials.Username + "/private/full");
        }


        // Tell the service to query:
        EventFeed calFeed = service.Query(query);
        return calFeed.Entries.Cast<EventEntry>();

关于c# - 与谷歌日历双向同步,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4332885/

相关文章:

c# - 将组合框添加到数据网格中的单元格

c# - 使用NAudio,ADTS AAC转WAV转码,怎么做?

c# - Google 中的 URL 索引

google-calendar-api - 将事件开始日期从 "date"更改为 "dateTime"

java - Google Calendar API 事件插入

android - Android 模拟器上的 Google 日历

c# - ASP.NET 获取 Web 应用程序的所有用户 session

c# - 正确获取磁盘大小

dart - 将谷歌日历插入 flutter 移动应用程序

javascript - 从 Calendar API 返回日期和时间数组