本文介紹了如何使用 .NET API 在 Google Drive 中創(chuàng)建文件夾?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在使用 C#、Google .NET API.如何在 Google Drive 根目錄中創(chuàng)建文件夾?任何代碼都會有所幫助.謝謝
I am using C#, Google .NET API. How can I create a folder in Google Drive root location? Any code will be helpful. Thanks
推薦答案
可以將文件夾視為具有特殊 MIME 類型的文件:application/vnd.google-apps.folder".
A folder can be treated as a file with a special MIME type: "application/vnd.google-apps.folder".
下面的 C# 代碼應該是你需要的:
The following C# code should be what you need:
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();
有關更多詳細信息,請查看文檔:https://developers.google.com/drive/folder一個>
For more details check the docs: https://developers.google.com/drive/folder
這篇關于如何使用 .NET API 在 Google Drive 中創(chuàng)建文件夾?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯(lián)網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!