使用 c# webclient 从 SharePoint Online 下载文档停止工作 [英] Download Document from SharePoint Online using c# webclient stopped working
本文介绍了使用 c# webclient 从 SharePoint Online 下载文档停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 c# webclient 从 SharePoint Online 下载文档停止工作!
Download Document from SharePoint Online using c# webclient stopped working!
多年来,我一直使用此代码从 SharePoint Online 下载文档.从 5 月 8 日起,我收到了 401 错误.
I have been using this code to download documents from SharePoint Online for years. Since 8th of May I'm getting 401 Error.
WebClient webClient = new WebClient();
webClient.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
SecureString securePassWord = new SecureString();
foreach (char c in password.ToCharArray()) securePassWord (c);
WebClient.Credentials = new SharePointOnlineCredentials(username, securePassWord);
byte[] fileBinary = webClient.DownloadData(fileUrl);
它应该仍然有效吗?
先谢谢了
推荐答案
我认为是为了:
securePassWord.AppendChar(c);
这篇关于使用 c# webclient 从 SharePoint Online 下载文档停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文