将电子表格添加到Google文档

时间:2014-03-19 13:12:40

标签: c# google-docs-api

我正在尝试向Google文档添加新的电子表格。我使用的是Visual Studio 2010,C#,.NET 4.0。

这是我的代码:

       DocumentsService docService = new DocumentsService("Application-v1");
       DocumentEntry entry = new DocumentEntry();
       docService.setUserCredentials("my_email@gmail.com", "PASSWORD");
       entry.Title.Text = "AddingNewSpreadsheet";
       entry.Categories.Add(DocumentEntry.SPREADSHEET_CATEGORY);
       DocumentEntry newEntry = service.Insert(DocumentsListQuery.documentsBaseUri, entry);

当我运行上面的代码时,Visual Studio会返回以下错误:

Execution of request failed: https://docs.google.com/feeds/default/private/full

错误显示在以下行中: DocumentEntry newEntry = service.Insert(DocumentsListQuery.documentsBaseUri, entry);

我应该在我的Feed中使用什么(service.Insert()的第一个参数)? Documents.ListQuery.documentsBaseUri是正确的选择吗?如何解决此错误?

0 个答案:

没有答案
相关问题