【问题标题】:How can I get a Google Document's Description?如何获取 Google 文档的描述?
【发布时间】:2012-05-12 21:37:28
【问题描述】:

目标

假设我在 Google Docs/Drive 中有一个文档集合/文件夹,我想以编程方式检索与每个文档关联的描述:

(您可以通过选择列表中的文件,然后点击“眼睛”图标来获得此信息)

工作代码

我正在使用.NET library for the Google Data API 并且基本的登录和检索工作没有问题:

GDataCredentials credentials = BuildSomethingUp();
RequestSettings settings 
    = new RequestSettings("code.google.com/p/exult/", credentials);
Request request = new Request(settings);
Feed<Document> feed = request.GetFolderContent(resourceId);                     
List<Document> documents = feed.Entries.ToList();

foreach (Document document in documents
    .Where(item => item.Type != Document.DocumentType.Folder))
{
   string summary = document.Summary; //y no can haz?
}

但是,.Summary 属性总是返回为 null。

问题

  1. 我一直在假设 .Summary 是基于一些已弃用的代码部分等的正确位置。这是一个虚假的假设吗?
  2. 我还能如何检索与文档关联的描述? (“我可以解密吗?”在上面可笑的例子中)

【问题讨论】:

    标签: c# google-data-api google-drive-api


    【解决方案1】:

    .NET 客户端库没有公开该字段,我只是在 rev 中提交了一些代码。 1189 (http://code.google.com/p/google-gdata/source/detail?r=1189) 将 Description 属性添加到 DocumentEntry 类。 您现在可以使用以下代码访问描述:

    string description = document.DocumentEntry.Description;
    

    【讨论】:

      猜你喜欢
      • 2022-07-20
      • 2018-01-28
      • 1970-01-01
      • 1970-01-01
      • 2018-05-08
      • 1970-01-01
      • 2013-05-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多