这是我目前拥有的
using (WebClient client = new WebClient()) {
WebProxy proxy = new WebProxy();
//proxy.Address = new Uri("http://" + proxyIP.Text + ":" + proxyPort.Text);
//proxy.Credentials = new NetworkCredential(proxyUsername.Text, proxyPassword.Text);
proxy.Address = new Uri("http://" + "96.44.147.138" + ":" + "6060");
proxy.Credentials = new NetworkCredential(proxyUsername.Text, proxyPassword.Text);
proxy.UseDefaultCredentials = false;
proxy.BypassProxyOnLocal = false;
client.Proxy = proxy;
Console.WriteLine(client.DownloadString("http://bot.whatismyipaddress.com/"));
}
问题是,我仍然收到错误消息
附加信息:远程服务器返回错误:(407) 需要代理身份验证。
尽管信息是正确的。
有任何想法吗?
我的问题没有通过其他线程解决,因为这个问题涉及using
并且我正在使用 winform 进行操作。