如何通过使用ASP.NET Core中的C#从SharePoint中读取和下载文件?

发布于 2025-01-25 21:06:01 字数 178 浏览 3 评论 0原文

我有一个应用程序,需要从SharePoint共享链接中阅读和下载文件。链接可以是文件夹,文件或zip文件链接。

请让我知道如何在.NET Core Application 3.1中实现此目标,并且如果我们必须使用任何Microsoft或其他外部API,则可以在需要注册并获取API请求的详细信息的位置。

提前致谢。

I have an application where I need to read and download the files from a SharePoint shareable link. Link can either be a folder, file or zip file link.

Please let me know how I can achieve this in my .net core application 3.1 and if we have to use any Microsoft or other external APIs then where I need to register and get the details for API request.

Thanks in Advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

顾铮苏瑾 2025-02-01 21:06:01

首选:

您可以参考此官方文档以在WebApp中添加GraphServiceClient。

构建ASP.NET核心MVC应用程序,用Microsoft Graph

然后您可以通过SDK下载文件。

第二选择:

您可以通过Microsoft Graph API获取@Microsoft.graph.downloadurl,然后您可以使用httpclient来请求此访问URL。

使用microsoft Graph api

=“ https://i.sstatic.net/jbsuz.png” rel =“ nofollow noreferrer”>

First Choice:

You can refer this official doc to add GraphServiceClient in your webapp.

Build ASP.NET Core MVC apps with Microsoft Graph

Then you can download file via SDK.

Second Choice:

You can get @microsoft.graph.downloadUrl via Microsoft Graph Api, then you can use HttpClient to request this url.

Download Sharepoint File using Microsoft Graph API

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文