我想使用代理,HttpWebRequest
但我的代理地址是 http://cdproxy.anadolu.edu.tr/proxy.pac,我不想将代理地址更改为 http://cdproxy.anadolu.edu.tr。
如何将此地址用于我的代理?
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
HttpWebRequest Request = (HttpWebRequest)HttpWebRequest.Create(Url);
CookieContainer cookieJar = new CookieContainer();
Request.AllowAutoRedirect = true;
WebProxy myProxy = new WebProxy();
myProxy.Address = new Uri("http://cdproxy.anadolu.edu.tr/proxy.pac");
myProxy.Credentials = new NetworkCredential("user", "password");
Request.Proxy = myProxy;
HttpWebResponse Response = (HttpWebResponse)Request.GetResponse();