0
我想添加一個事件到谷歌日曆使用此代碼來設置作者:設置事件作者與谷歌日曆API
CalendarService service = new CalendarService("TestApp");
service.setUserCredentials("[email protected]", "1234");
EventEntry entry = new EventEntry();
// Set the title and content of the entry.
entry.Title.Text = "Test";
entry.Content.Content = "Test";
// Not working
AtomPerson author = new AtomPerson(AtomPersonType.Author);
author.Name = "John Doe";
author.Email = "[email protected]";
entry.Authors.Add(author);
When eventTime = new When(activity.Start, activity.End, activity.Start == activity.End ? true : false);
entry.Times.Add(eventTime);
Uri postUri = new Uri("https://www.google.com/calendar/feeds/default/private/full");
// Send the request and receive the response:
AtomEntry insertedEntry = service.Insert(postUri, entry);
此次活動除了作者所有正確的屬性添加得到。作者仍然是日曆的所有者。有任何想法嗎?