Mono 使用 Google Data API 使用 C# 访问 Google 电子表格失败 [英] Accessing Google Spreadsheets with C# using Google Data API fails with Mono

查看:12
本文介绍了Mono 使用 Google Data API 使用 C# 访问 Google 电子表格失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 GData API 访问我的 Google 电子表格.我遵循了如下示例:

I'm trying to access my Google spreadsheets using the GData API. I have followed the example which looks like:

var service = new SpreadsheetsService("myTest");
service.setUserCredentials(username, password);
var query = new SpreadsheetQuery();
var feed = service.Query(query);

这应该会返回一个包含电子表格列表的提要.然而这失败了:

This should return a feed with a list of spreadsheets. However this fails with:

Google.GData.Client.GDataRequestException:请求执行失败:http://spreadsheets.google.com/feeds/spreadsheets/private/full ---> System.Net.WebException:远程服务器返回错误:(404)未找到.

Google.GData.Client.GDataRequestException: Execution of request failed: http://spreadsheets.google.com/feeds/spreadsheets/private/full ---> System.Net.WebException: The remote server returned an error: (404) Not Found.

当我直接在浏览器中尝试上述链接时,只要我登录到我的 Google 帐户,我就可以下载该提要.

When I try the above link directly in my browser I'm able to download the feed, as long as I'm logged in into my Google account.

一些进一步的信息:

  1. 我不在防火墙后面
  2. 我已多次检查我的用户名(maurits.rijk at gmail.com)和密码
  3. 我在 MacBook 上的 VirtualBox 中使用 Mandriva
  4. 我所有的代码都是用 Mono 编译的

我在 OS-X 上的 Java 中尝试了相同的功能.该代码按预期运行.

I tried the same functionality in Java on OS-X. That code runs as expected.

推荐答案

我在 Google 代码,第 88 期 作为评论 8.

I found the problem and solution on Google code, Issue 88 as comment 8.

简而言之,使用

mozroots --import --sync --quiet

mozroots --import --sync --quiet

解决了这个问题.对我来说,它现在可以工作了.

solves this problem. For me it now works.

这篇关于Mono 使用 Google Data API 使用 C# 访问 Google 电子表格失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆