我正在尝试将事件添加到谷歌日历中的特定日历,但我只是不知道如何。这是我的代码:
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);
谁能帮我解决这个问题?
编辑
也许我应该提一下,只有想要轻松添加集合点和注释到他的谷歌日历的站点管理员才能访问此功能,所以我使用“硬编码”值自动对其进行身份验证,所以我确定用户名和密码是好的。