gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 23:03:39 26 4
gpt4 key购买 nike

你们知道 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com