我正在尝试将某个事件添加到Google日历中的特定日历,而我只是没有找到如何。这是我的代码:使用GData API向“特定”Google日历添加事件
CalendarService service = new CalendarService("MyTEst");
service.setUserCredentials("Username", "Password");
EventEntry entry = new EventEntry();
// Set the title and content of the entry.
entry.Title.Text = "title";
entry.Content.Content = "test";
// Set a location for the event.
Where eventLocation = new Where();
eventLocation.ValueString = "Location";
entry.Locations.Add(eventLocation);
When eventTime = new When(DateTime.now, DateTime.now.AddDays(2));
entry.Times.Add(eventTime);
Uri postUri = new Uri("http://www.google.com/calendar/feeds/default/private/full");
// Send the request and receive the response
AtomEntry insertedEntry = service.Insert(postUri, entry);
任何人都可以帮我解决这个问题吗?
编辑
也许我应该提到这fonctionnability仅仅是一个网站的管理员,其想要伊斯利添加会合,并注意自己的谷歌日历,让我automaticaly与“硬编码”认证的可访问值,所以我确信用户名和密码都可以。
非常感谢DanJo519。我现在就试试这个! – 2010-01-27 21:22:05
我试过了,它仍然失败成为一个错误;执行请求失败:google.com/calendar/feeds/[email protected]/private-PRIVATE_KEY/full。我不明白。我已经在最后尝试了“全部”或“基本”(基本是从谷歌默认提供的,但我已经尝试过,因为太完美了,所以你说了这样的话)。无论如何,没有人工作:( – 2010-01-27 22:01:03
我已经做了修改我的答案是,你实际上不需要包含-PRIVATE_KEY,如果删除了,你可以发布,假设你在日历上有写权限,我已经用我的一个辅助日历成功测试过了。 – 2010-01-29 15:39:01