2016-06-14 149 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