我想将 Google 文档的内容显示到我自己的页面中。
我可以使用以下方式获取所有文档的列表
http://code.google.com/apis/documents/docs/2.0/developers_guide_dotnet.html http://code.google.com/apis/documents/docs/2.0/developers_guide_dotnet.html
DocumentsService service = new DocumentsService("exampleCo-exampleApp-1");
service.setUserCredentials("[email protected] /cdn-cgi/l/email-protection", "mypassword");
DocumentsListQuery query = new DocumentsListQuery();
DocumentsFeed feed = service.Query(query);
foreach (DocumentEntry entry in feed.Entries)
{
Console.WriteLine(entry.Title.Text);
}
如何在我的页面中显示文档内容?
您可以通过以下代码获取内容。
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();
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)