这是我的代码,确保这些请求通过远程代理传递的最佳方法是什么?
String openUrl = @"www.site.com/page.html";
WebClient myClient = new WebClient();
myClient.UseDefaultCredentials = true;
IWebProxy theProxy = myClient.Proxy;
if (theProxy != null)
{
theProxy.Credentials = CredentialCache.DefaultCredentials;
}
myClient.Proxy = WebRequest.DefaultWebProxy;
string webPageString = myClient.DownloadString(openUrl);
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml(webPageString);