我使用以下代码来访问互联网上的html数据:
- WebProxy p = new WebProxy("localproxyIP:8080",true);
- p.Credentials = new NetworkCredential("domain\\user","password");
- WebRequest.DefaultWebProxy = p;
- WebClient client = new WebClient();
- string downloadString = client.DownloadString("http://www.google.com");
但是出现以下错误:“需要代理验证”.
我不能使用默认代理,因为我的代码从没有默认代理设置的特殊帐户下的Windows服务运行.
所以,我想标明我的代码中的所有代理设置.
请告诉我如何解决这个错误.