简体   繁体   中英

Create folder on Google Drive .NET

I'm trying to use Google Drive SDK. I'm okay with authentication and getting instance of DriveService . But I want to add a simple folder on root, I've found this:

File body = new File();
body.Title = "document title";
body.Description = "document description";
body.MimeType = "application/vnd.google-apps.folder";

// service is an authorized Drive API service instance
File file = service.Files.Insert(body).Fetch();

But Google.Apis.Drive.v2.FilesResource.InsertRequest don't have Fetch method?

How can I use File object to insert it on root folder?

File file = service.Files.Insert(body).Execute();

Work perfectly !!!

i've just had an error in my class that implement IDataStore.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM