繁体   English   中英

在Google电子表格中插入行

[英]Insert rows into google spreadsheet

我需要在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”错误。 请帮忙。

您正在使用OAuth1.0吗? 根据2015年5月提交的票证 ,OAuth1.0现在(自2015年5月起)已弃用,应迁移到OAuth2.0使用。 似乎返回了您遇到的相同错误消息。

有关OAuth2.0使用情况的更多信息,请参见开发人员页面

希望这可以帮助!

暂无
暂无

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

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