Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用Google日历API设置事件作者_C#_.net_Google Api_Google Calendar Api - Fatal编程技术网

C# 使用Google日历API设置事件作者

C# 使用Google日历API设置事件作者,c#,.net,google-api,google-calendar-api,C#,.net,Google Api,Google Calendar Api,我试图在将事件添加到Google日历时使用以下代码设置作者: CalendarService service = new CalendarService("TestApp"); service.setUserCredentials("example@gmail.com", "1234"); EventEntry entry = new EventEntry(); // Set the title and content of t

我试图在将事件添加到Google日历时使用以下代码设置作者:

        CalendarService service = new CalendarService("TestApp");
        service.setUserCredentials("example@gmail.com", "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 = "john@example.com";
        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);

事件将添加除作者之外的所有正确属性。作者仍然是日历的所有者。有什么想法吗?

根据日历API文档(http://code.google.com/apis/calendar/data/2.0/developers_guide_protocol.html#CreatingSingle):

服务器将根据用户插入作者信息 提交请求(即,其身份验证令牌 随请求一起)

创建事件时,无法设置“作者”字段的值