简体   繁体   English

如何使用OneDrive SDK创建文件夹

[英]How to create a folder using OneDrive SDK

For the life of me I cannot find out how to create a folder or list all folders using the OneDrive SDK. 我一生都无法找到如何使用OneDrive SDK创建文件夹或列出所有文件夹的方法。 Note please this is using the SDK NOT Api. 请注意,这是使用SDK NOT Api。 Can someone please show me how to do this? 有人可以告诉我该怎么做吗?

My aim is to allow users to upload files to a custom directory using a onedrive app using the onedrive SDK 我的目标是允许用户使用onedrive SDK使用onedrive应用程序将文件上传到自定义目录

As much as I know SDK uses the same API in the box. 据我所知,SDK在框中使用了相同的API。 Anyway you can try the following way: 无论如何,您可以尝试以下方式:

var folderToCreate = new Item { Name = folderName, Folder = new Folder() };
var newFolder = await client.Drive.Items[parentId].Children.Request().AddAsync(folderToCreate);

https://github.com/OneDrive/onedrive-sdk-csharp/issues/24 https://github.com/OneDrive/onedrive-sdk-csharp/blob/master/docs/items.md#create-a-folder https://github.com/OneDrive/onedrive-sdk-csharp/issues/24 https://github.com/OneDrive/onedrive-sdk-csharp/blob/master/docs/items.md#create-a-folder

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用OneDrive SDK将OneDrive上的文件夹/文件上传到Windows 10 UWP - How to upload a folder/file on onedrive using the onedrive sdk for windows 10 UWP 如何使用OneDrive SDK按文件哈希搜索 - How to search by file hash using OneDrive SDK OneDrive CSharp SDK和OneDrive REST API-如何确定文档是文件还是文件夹? - OneDrive CSharp SDK and OneDrive REST API - how to determine if a document is a file or folder? Microsoft onedrive:使用API​​密钥创建文件夹而无需登录 - Microsoft onedrive: Create folder using API key without login 使用OneDrive API创建App文件夹和上传文件 - Create App folder and upload file using OneDrive API 如何使用OneDrive SDK更新存储在OneDrive(业务)上的文件的创建和/或最后修改时间 - How can I update the creation and/or the last modified time of a file stored on OneDrive (Business) using the OneDrive SDK 如何提高使用 OneDrive SDK 上传大文件的速度 - How to improve speed when uploading large files using OneDrive SDK 如何使用OneDrive API将文件上传到OneDrive上的共享文件夹中? - How can I upload files into a shared folder on OneDrive using OneDrive API? 如何使用C#Windows App读取OneDrive文件夹 - How to read a onedrive folder using c# windows app 如何使用C#从OneDrive中的共享文件夹下载文件? - How to download a file from shared folder in onedrive using c#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM