谷歌API来获取文档/电子表格中以后的内容 [英] Google API to get the Content of Document/SpeadSheet

查看:511
本文介绍了谷歌API来获取文档/电子表格中以后的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示一个谷歌文件的内容到自己的网页。

I want to get Display the content of a Google Doc in to the My own page.

我可以得到所有文件的列表中通过使用

I can get the List of all Document By using

HTTP://$c$c.google。 COM /的API /文件/文档/ 2.0 / developers_guide_dotnet.html

 DocumentsService service = new DocumentsService("exampleCo-exampleApp-1");
service.setUserCredentials("jo@gmail.com", "mypassword");
DocumentsListQuery query = new DocumentsListQuery();

DocumentsFeed feed = service.Query(query);

foreach (DocumentEntry entry in feed.Entries)
{
    Console.WriteLine(entry.Title.Text);
}

任何人可以帮助我,我怎么能显示文档中我的页面内容。

Can anybody help me how can I display the content of Document in My page.

推荐答案

您可以通过以下code含量。

You can get the Content by the below code.

 string content = string.Empty;
    string ACLS=string.Empty;
    foreach (DocumentEntry entry in feed.Entries)
    {

    if (entry.IsDocument)
    {
    var stream = client.Query(new Uri(entry.Content.Src.ToString()));
    var reader = new StreamReader(stream);
    content = reader.ReadToEnd();
    }
    }

这篇关于谷歌API来获取文档/电子表格中以后的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆