我一直在如何让我的C#Windows窗体从谷歌阅读表读了。C#和谷歌表
我认为我对如何阅读和写作有很好的把握,但是我对于如何入门感到难以置信。
我假定步骤如下:
1.(DONE)获取API设置:https://developers.google.com/sheets/api/quickstart/dotnet
2.(此处卡住)加载了片材。我不知道如何做到这一点。我坚持这一点。我一直无法在API页面上找到关于如何实际加载工作表的指南,也无法在线查找有关如何完成相同工作的更新代码示例/指南。
3.读取/写入/更新值。
在此页面:https://developers.google.com/sheets/api/guides/concepts底部似乎使用GET然后将薄层URL来获取片建议。但是,当我使用GET时,出现此错误:无法找到类型或名称空间“GET”。
这里是到目前为止我的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
GET https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId?ranges=A1:C10&fields=properties.title,sheets(sheetProperties,data.rowData.values(effectiveValue,effectiveFormat))
}
}
这有什么做与谷歌表。编译器错误说你忘了在你的表单中创建一个'GetCredential()'方法 –
@PJvG谢谢你的回复!自从我开始变得非常困惑并从头开始,我实际上已经报废了整个应用程序。我会更新原文,以反映我实际上在执行的步骤。 – lolikols
@lolikols不健全粗鲁,但你要停留在是没有什么特定的读/写谷歌表,而是在基本的C#语法的缺乏。对于你来说,花更多时间通过教程和书籍来学习语言可能会更有意义,否则你可能会一次又一次地遇到同样的问题。 – DrewJordan