【问题标题】:Insert rows into google spreadsheet将行插入谷歌电子表格
【发布时间】:2015-12-11 07:12:54
【问题描述】:

我需要在 Google 电子表格中插入行。下面是我正在使用但无法插入行的代码。没有构建问题。编译成功。

 SpreadsheetsService GoogleExcelService =  new SpreadsheetsService("GoogleSheet");

        protected void Page_Load(object sender, EventArgs e)
        {
            //Pass Google credentials 
            GoogleExcelService.setUserCredentials("user@gmail.com", "password");

            ListEntry entry = new ListEntry();
            //Add new row data with productname bottles and quantity 100.
            entry.Elements.Add(new ListEntry.Custom() { LocalName = "productname", Value = "Bottles" });
            entry.Elements.Add(new ListEntry.Custom() { LocalName = "quantity", Value = "100" });

            //AtomEntry retEntry = GoogleExcelService.Insert(

            AtomEntry retEntry = GoogleExcelService.Insert(new Uri("***WHAT URI I SHOULD PROVIDE HERE"), entry);
        }
    }

我已经花了太多时间来解决这个问题,但没有运气。我收到“执行身份验证请求返回意外结果:404”错误。请帮忙。

【问题讨论】:

    标签: c# asp.net google-sheets google-spreadsheet-api


    【解决方案1】:

    您使用的是 OAuth1.0 吗?根据 2015 年 5 月提交的 ticket,OAuth1.0 现已弃用(截至 2015 年 5 月),应迁移到 OAuth2.0 使用。它似乎返回了您遇到的相同错误消息。

    有关 OAuth2.0 使用的更多信息,请参阅developer page

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-08
      • 1970-01-01
      相关资源
      最近更新 更多