RT:我目前的写法不管用public static void ProxySetting(HttpWebRequest request)
{
            WebProxy myProxy = new WebProxy();
            Uri newUri = new Uri("proxy.xxx.xxx:3128");
            myProxy.Address = newUri;
            request.Proxy = myProxy;
}

解决方案 »

  1.   

    HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
    WebProxy myProxy = new WebProxy("10.214.45.28:8080", true);
    myProxy.Credentials = new NetworkCredential("id", "password");
    req.Proxy = myProxy;
      

  2.   

    myProxy.Credentials = new NetworkCredential("id", "password");
    这是什么意思?
      

  3.   

    代理是否可用
    string url = "";   
    HttpWebRequest hwr = (HttpWebRequest)HttpWebRequest.Create(url);   
    hwr.Timeout = 60000;   
    WebProxy proxy = new WebProxy();   
    proxy.Address = new Uri("");   
    proxy.Credentials = new NetworkCredential("", "");   
    hwr.UseDefaultCredentials = true;   
    hwr.Proxy = proxy; 或 System.Net.WebRequest.GetSystemWebProxy();HttpWebResponse req= (HttpWebResponse)hwr.GetResponse();   
    Stream s = req.GetResponseStream();   
    StreamReader sr = new StreamReader(s, Encoding.UTF8);
      

  4.   

    new NetworkCredential("id", "password");代理的用户名和密码啊