Vote count:
0
I am a .net programmer and I want to use Google Drive Api to get all the folders from a service account's my drive folder.
The program works fine but looks like every time there is more folders retrieved. I have used the sample code:
internal static List<File> GetAllFolders(DriveService service)
{
var result = new List<File>();
var request = service.Files.List();
do
{
try
{
var files = request.Execute();
result.AddRange(files.Items);
request.PageToken = files.NextPageToken;
}
catch (Exception e)
{
Console.WriteLine("An error occurred: " + e.Message);
request.PageToken = null;
}
} while (!String.IsNullOrEmpty(request.PageToken));
return result.Where(f=>f.MimeType.Equals(MimeType.Folder)).ToList();
}
Please help. Thanks.
asked 31 secs ago
using Google Drive SDK for .net desktop program issue
Aucun commentaire:
Enregistrer un commentaire