如何使用 .NET API 在 Google Drive 中创建文件夹?

编程入门 行业动态 更新时间:2024-10-24 20:11:21
本文介绍了如何使用 .NET API 在 Google Drive 中创建文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用 C#、Google .NET API.如何在 Google Drive 根目录中创建文件夹?任何代码都会有所帮助.谢谢

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();

有关更多详细信息,请查看文档:developers.google/drive/folder

For more details check the docs: developers.google/drive/folder

更多推荐

如何使用 .NET API 在 Google Drive 中创建文件夹?

本文发布于:2023-11-28 09:39:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641879.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   文件夹   NET   API   Google

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!