zoukankan      html  css  js  c++  java
  • HttpWebResponse 远程服务器返回错误: (407) 需要代理身份验证。

    天在公司 爬自己本地iis是出现一个 错误提示“ 远程服务器返回错误: (407) 需要代理身份验证” ,现在把解决方案提出来         static bool GetRequest(string url)
            {
                WebProxy proxy = new WebProxy("10.16.8.52:80", false);
                proxy.Credentials = new NetworkCredential("majiang", "****", "Vancl");

                HttpWebRequest request = HttpWebRequest.Create(url) as HttpWebRequest;
                request.AllowAutoRedirect = false;
                request.Proxy = proxy;
                HttpWebResponse response = request.GetResponse() as HttpWebResponse;
                response.Close();
                return response.StatusCode == HttpStatusCode.OK;
            }

  • 相关阅读:
    视图
    触发器
    DNS
    DHCP
    SSH 详解
    apt-get
    java split
    数组指针 指针数组
    函数指针
    网络协议
  • 原文地址:https://www.cnblogs.com/majiang/p/2716567.html
Copyright © 2011-2022 走看看