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

starseeker7 2013-12-13 08:23:54
如题,一个曾经正常使用的代码
因公司把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的情况
求各位大大解惑,谢谢
...全文
125 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
starseeker7 2013-12-18
  • 打赏
  • 举报
回复
C#区看来很少人关注sharepoint呢 已在sharepoint区找到大大解决,有兴趣的可以看以下地址,结贴 http://bbs.csdn.net/topics/390667750

110,530

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧