使用c#编写APP上传文件到sharepoint2013出错

starseeker7 starseeker7 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
如题,一个曾经正常使用的代码
因公司把sharepoint2003升级到了2013,这个客户端程序就无法使用了- -
提示错误"The remote server returned an error: (403) Forbidden.“

try
{
using (WebClient IR = new WebClient())
{
IR.Credentials = new NetworkCredential("username", "pwd", "域名");
IR.UploadFile(@"http://sitename/file/filename.xml", "put", @"F:\File\filename.xml");
}

}
catch (System.Net.WebException webex)
{
MessageBox.Show("Update File Error(System.Net.WebException):" + webex.Message.ToString());
}
catch (Exception ex)
{
MessageBox.Show("Update File Error(System.Exception):" + ex.Message.ToString());
}





网上查询了参考资料
http://blog.symprogress.com/2013/07/upload-wsp-file-to-office365-sp2013-using-webclient/
但按照他提供的代码会提示无法调用Microsoft.SharePoint.Client.Runtime的情况
求各位大大解惑,谢谢
...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
starseeker7
C# 111,128 成员 642,536 内容