本文介绍了错误403禁止webclient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好 我尝试将文件发送到网址。总是,我发现以下异常:" 远程服务器错误(403):禁止" 我的代码是: objWebClient = new WebClient ();HiI try send file to url. Always, I catch the following exception : "Error in remote server (403) : prohibited"My code is :objWebClient = new WebClient(); uriWebClient = new Uri (" url" ; );uriWebClient = new Uri("url"); objWebClient.Credentials = new NetworkCredential (" id" , " passwors" );objWebClient.Credentials = new NetworkCredential("id", "passwors"); byte [] buffer = System.Text。 编码 .UTF8.GetBytes(file); //要上传的xml文件byte[] buffer = System.Text.Encoding.UTF8.GetBytes(file);//xml file to upload objWebClient.Headers.Add( " Content-Type" , " text / xml" ) ;objWebClient.Headers.Add("Content-Type", "text/xml"); buffer = objWebClient.UploadData(uriWebClient, " POST" ,buffer);buffer = objWebClient.UploadData(uriWebClient, "POST", buffer); string strResponse = 编码 .ASCII.GetString(buffer);string strResponse = Encoding.ASCII.GetString(buffer);调用UploadData方法时抛出异常。 server adminitrador说我有权读/写。 我可以访问服务器,但是我无法发送数据。 有人可以帮我吗? >谢谢Exception throw when I call the UploadData method.The server adminitrador say me that I have permission to read/write.I can access to the server, but I can´t send data.can anybody help me?Thanks推荐答案是UrlScan安装在服务器上?Is UrlScan installed on the server? 这篇关于错误403禁止webclient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-03 20:46