首页 文章

使用Office 365客户端库访问OneDrive for Business中的共享文件

提问于
浏览
0

有没有办法使用Office 365客户端库访问OneDrive for Business上的共享文件?有很多关于如何访问MyFiles的例子,比如github上的this伟大的一个 .

Graph API可通过以下方式访问:

https://graph.microsoft.com/v1.0/drives/[DRIVEID]/items/[FOLDERID]/children

我还没有找到一种方法来访问SharePointClient,只有:

var filesResult = await client.Files.ExecuteAsync();

1 回答

  • 1

    OneDrive for Business有一个C#SDK,可用于提取用户的文件 .

    要获得用户的驱动器:

    var drive = await oneDriveClient
                          .Drive
                          .Request()
                          .GetAsync();
    

    要获取根文件夹文件:

    var rootItem = await oneDriveClient
                                 .Drive
                                 .Root
                                 .Request()
                                 .GetAsync();
    

    这是一个GitHub回购网址:

    https://github.com/onedrive/onedrive-sdk-csharp

    如果您有任何疑问,请告诉我 .

相关问题