2013-05-03 45 views
0

我试图提取一个谷歌驱动器文件的内容。这是一个谷歌文档文件。我有代码来拉整个文件,包括元数据等。我看到有关这个谷歌api页面:https://developers.google.com/drive/...m_google_drive将Google文档内容检索到vb窗体中

我有麻烦能够解析身体出我的代码从我得到的。有没有人做过这个?谢谢,维克多。

Dim request As HttpWebRequest = DirectCast(WebRequest.Create("insert google doc url here"), HttpWebRequest) 

       Dim response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse) 

       Dim Stream As Stream = response.GetResponseStream() 

       Dim reader As StreamReader = New StreamReader(Stream) 

       MsgBox(reader.ReadToEnd) 

回答

0

get方法返回导出链接。我认为您可以使用此方法检索文件元数据并导出链接以检索内容。您可以将文件导出为“纯文本”格式和RTF格式(以及其他许多格式)。

下面包含的URL到文件的内容(从APIs explorer)一个予本实施例的图像: enter image description here

实施例链接:

application/rtf: https://docs.google.com/feeds/download/documents/export/Export?id=ID&exportFormat=rtf 

text/plain: https://docs.google.com/feeds/download/documents/export/Export?id=ID&exportFormat=txt 
相关问题