有没有人有一个很好的C#示例用于使用v4 API更新单元格?
我在使用Google表格API v4的开发者网站上获得了获取单元格值c#示例.我试图修改示例以更新值为"Tom"的单元格.我坚持设置SpreadSheets.Values.Update.
using Google.Apis.Auth.OAuth2;
using Google.Apis.Sheets.v4;
using Google.Apis.Sheets.v4.Data;
using Google.Apis.Services;
using Google.Apis.Util.Store;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace GoogleSheetsAPI4_v1console
{
class Program
{
// If modifying these scopes, delete your previously saved credentials
// at ~/.credentials/sheets.googleapis.com-dotnet-quickstart.json
static string[] Scopes = { SheetsService.Scope.Spreadsheet };
static string ApplicationName = "TestSpreadsheet";
static void Main(string[] args)
{
UserCredential credential;
using (var stream =
new FileStream("client_secret.json", FileMode.Open, FileAccess.Read))
{
string credPath = …Run Code Online (Sandbox Code Playgroud) c# google-api google-sheets google-api-dotnet-client google-sheets-api
我正在使用ruby客户端使用Google :: Apis :: SheetsV4 :: SheetsService类更新现有的电子表格范围,但无法找到创建新工作表的方法.我想为每个新的一年创建一个新表.我想通过标题测试电子表格中是否存在工作表,如果不存在则添加新工作表.我找不到任何帮助我完成任务的ruby代码示例.
这不能与作为重复问题提出的链接重复,因为我在下面的回答中的ruby代码与用C#编写的解决方案非常不同.
http://www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/SheetsV4/SheetsService
这是我的一些代码:
require 'google/apis/sheets_v4'
Run Code Online (Sandbox Code Playgroud)
SCOPE = Google::Apis::SheetsV4::AUTH_SPREADSHEETS
Run Code Online (Sandbox Code Playgroud)
spreadsheet_id = '1NTvP-VkDDE1_xzz_etc'
Run Code Online (Sandbox Code Playgroud)