繁体   English   中英

请求执行失败:https://www.google.com/calendar/feeds/default/private/full

[英]Execution of request failed: https://www.google.com/calendar/feeds/default/private/full

我正在尝试通过接受Winform中的事件详细信息来将事件添加到Google日历中

尝试添加事件时,出现以下错误“请求执行失败: https : //www.google.com/calendar/feeds/default/private/full

代码如下:

        CalendarService myService = new CalendarService("exampleCo-exampleApp-1");
        myService.setUserCredentials("username@gmail.com", "password");


        EventEntry entry = new EventEntry();

        entry.Title.Text = textBox1.Text;
        entry.Content.Content = textBox2.Text;
        Where eventLocation = new Where();
        eventLocation.ValueString = textBox3.Text;
        entry.Locations.Add(eventLocation);

        When eventTime = new When();
        eventTime.StartTime =Convert.ToDateTime(textBox4.Text);
        entry.Times.Add(eventTime);

        Uri postUri = new Uri("http://www.google.com/calendar/feeds/default/private/full");

        AtomEntry insertedEntry = myService.Insert(postUri, entry);

有人可以帮我吗? 我已经尝试过基本和完整两者,并且也删除了私有内容,我还缺少什么吗?

im传递的日历凭据可以访问日历,并且确实有多个日历。

我知道所有Google API都需要OAuth 2身份验证。 我不确定您的CalendarService类是否在使用Google API库。 好像您自己在做身份验证?

我强烈建议您使用Google API .Net客户端简化所有步骤。 该库包含Calendar API方法,使其非常简单。

https://code.google.com/p/google-api-dotnet-client/

https://code.google.com/p/google-api-dotnet-client/wiki/OAuth2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM