2016-06-14 148 views
0

我想列出子文件夹中的所有文件。我不理解API参考。 例如路径 我在Google云端硬盘中的路径是CR/CA/UP /文件。 我在Google云端硬盘中的路径是CR/NA/UP /文件。 我在Google云端硬盘中的路径是CR/DD/UP /文件。在Google Drive REST API中查找文件的路径

对于由谷歌文档提供的字符串q list,我应该如何通过这个?

这是我正在使用的问。请咨询我错了用于Q

string Q = "'CR' IN parents and title = 'UP' and trashed = 'false' and mimeType = 'application/vnd.google-apps.folder'"; 
IList<File> _Files = GoogleDriveHelper.GetFiles(service, Q); 

当我使用这个是工作,但我不知道指的是父文件夹的钙,钠或DD

string Q = "title = 'UP' and trashed = 'false' and mimeType = 'application/vnd.google-apps.folder'"; 

回答

0

To list a folders contents即孩子,你需要使用这个HTTP请求

GET https://www.googleapis.com/drive/v2/files/folderId/children 

要列出根文件夹中的所有儿童,使用别名rootfolderId值。

q当您想要搜索文件夹内的特定文件时,使用参数,它是一个组合一个或多个搜索项的搜索查询。

+0

这是行不通的。 – Yeep

+1

string Q =“mimeType ='application/vnd.google-apps.file'和root ='NA'并且trashed = false且title ='xxx'”; – Yeep

+0

https://developers.google.com/drive/v2/web/search-parameters#operators – Yeep