我正在尝试使用以下函数检索google文档中的文件夹中的所有文档,如API文档中的给出..但该函数仍然返回所有文档的标题,而不仅仅是该特定文件夹的标题.. < / p>
public DocumentsFeed RetrieveDocsInFolder(DocumentsService service, string folder, string email)
{
AtomCategory folderCategory = new AtomCategory(folder,
new AtomUri("http://schemas.google.com/docs/2007/folders/" + email));
QueryCategory folderQueryCategory = new QueryCategory(folderCategory);
DocumentsListQuery query = new DocumentsListQuery();
query.Categories.Add(folderQueryCategory);
query.CategoryQueriesAsParameter = true;
return service.Query(query);
}
答案 0 :(得分:0)
请尝试以下代码:
public DocumentsFeed RetrieveDocsInFolder(DocumentsService service, string folder)
{
string uri = String.Format(DocumentsListQuery.foldersUriTemplate, folder);
DocumentsListQuery query = new DocumentsListQuery(uri);
return service.Query(query);
}
我假设folder
是您要为其检索内容的文件夹的资源ID。