【问题标题】:Access shared files in OneDrive for Business with Office 365 client libraries使用 Office 365 客户端库访问 OneDrive for Business 中的共享文件
【发布时间】:2016-01-21 11:51:31
【问题描述】:

是否可以使用 Office 365 客户端库访问 OneDrive for Business 上的共享文件?有很多关于如何访问 MyFiles 的示例,例如 github 上的 this great one。

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

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

我还没有找到使用 SharePointClient 访问相同的方法,只有:

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

【问题讨论】:

    标签: .net office365 onedrive office365api


    【解决方案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

    如果您有任何问题,请告诉我。

    【讨论】:

    • 是的,如果我可以让它在 ASP .NET 上运行,那应该可以。看起来这个线程有一些问题-> github.com/OneDrive/onedrive-sdk-csharp/issues/45。来自 MS 的 Ginach 说:“使用客户端密码的身份验证尚未完全实现。” (9 天前)。
    • sdk 包含一个 WinForms 示例,但我无法在 ASP .NET 应用程序中执行此操作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多