c# - 如何在不使用 API 登录的情况下检索公共(public) Google 文档?

标签 c# .net google-docs

我已经在网络上公开分享了一些文档。有什么方法可以在不登录的情况下使用 Google API 检索这些文档吗?

最佳答案

你会做的是

// http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx
WebClient wc = new WebClient();

// http://msdn.microsoft.com/en-us/library/ms144200.aspx
string priceList=wc.DownloadString(
    new Uri(
        "https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0Aic3jYFcLTrldEhQU1dDTzdTdFBhaVA4OGtPX2FUMUE&single=true&gid=0&output=txt");

// http://msdn.microsoft.com/en-us/library/3cc9y48w.aspx
wc.Dispose(); // Free resources

// http://msdn.microsoft.com/en-us/library/tabh47cf.aspx
string[] lines = priceList.Split(
    new string[] {
        "\r\n",
        "\n\r", // Rarely ever used, but be prepared
        "\n" // Match this and
        "\r" }, // this last
StringSplitOptions.None);

关于c# - 如何在不使用 API 登录的情况下检索公共(public) Google 文档?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10842950/

相关文章:

python - 提取 DOCX 注释

c# - 如何在反射中使用不完整的类型?

javascript - 如何使用 jQuery 跟踪文本框中的更改

.net - 在绑定(bind)到 DataGridView 的 DataTable 上触发更新

c# - 实现 C# 超时

google-apps-script - 使用 Google Apps 脚本删除 Google 文档中的表格行

c# - 存储网站登录凭据的最佳方法

c# - 创建显示多维数据集 View 的软件的想法?

.net - .NET 的 SOLID DDD ORM 请求(使用干净的实体和存储库)

json - 谷歌电子表格检索 JSON 提要