你试过:
WebProxy proxy = new WebProxy(@"http://myproxy.com/proxypac.asp");
或者
WebProxy proxy = WebRequest.GetSystemWebProxy();
一种解决方法是打开你的文件,并检查其内容看代理ADRESS和端口你。
如果您下载myproxy.com/proxypac.asp
文件时,它应该是这样的:
function FindProxyForURL(url, host) {
// our local URLs from the domains below example.com don't need a proxy:
if (shExpMatch(url,"*.example.com/*")) {return "DIRECT";}
if (shExpMatch(url, "*.example.com:*/*")) {return "DIRECT";}
// URLs within this network are accessed through
// port 8080 on fastproxy.example.com:
if (isInNet(host, "10.0.0.0", "255.255.248.0")) {
return "PROXY fastproxy.example.com:8080";
}
// All other requests go through port 8080 of proxy.example.com.
// should that fail to respond, go directly to the WWW:
return "PROXY proxy.example.com:8080; DIRECT";
}
“看来要失败” ......与异常?你怎么知道一定的? –
看看这篇文章:http://msdn.microsoft.com/en-us/magazine/cc300743.aspx –
错误很简单; '远程服务器返回错误:(400)错误的请求。' – creatiive