如何通过使用ASP.NET Core中的C#从SharePoint中读取和下载文件?
我有一个应用程序,需要从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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首选:
您可以参考此官方文档以在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