我想用谷歌日历 http://en.wikipedia.org/wiki/Google_Calendar为了添加派对活动,所以我添加了一个新的日历“活动”。有没有删除该日历中所有事件的功能?
或者只能通过删除整个日历并重新创建它来实现?
我有每天更新的离线数据,所以我认为最好的方法是刷新整个 Google 日历日历并简单地上传所有事件。
这很有帮助:Google 日历 .NET API 文档 http://code.google.com/apis/calendar/data/2.0/developers_guide_dotnet.html/.
// Create a CalenderService and authenticate
CalendarService myService = new CalendarService("exampleCo-exampleApp-1");
myService.setUserCredentials("[email protected] /cdn-cgi/l/email-protection", "mypassword");
// Create the query object:
EventQuery query = new EventQuery();
query.Uri = new Uri("https://www.google.com/calendar/feeds/[calendar]/private/full");
其中 [日历] = "[电子邮件受保护] /cdn-cgi/l/email-protection“对于默认日历或在您的实例中,您的“事件”日历的 ID(在 Gmail 日历中找到),即 https://www.google.com/calendar/[calendarID]/private/full”
// Tell the service to query:
EventFeed calFeed = myService .Query(query);
// This should delete all items in your calendar
foreach(var item in calFeed.Entries) {
entry.Delete();
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)