C# WebClient 使用http免费代理。


static void Main(string[] args)
        {
            WebClient client = new WebClient();
            client.Encoding = Encoding.GetEncoding("gb2312");
            if (true)
            {
                WebProxy proxy = new WebProxy();
                proxy.UseDefaultCredentials = false;
                proxy.Address = new Uri("http://183.239.167.122:8080"); // new Uri("http://183.239.167.122:8080");
                client.Proxy = proxy;
            }

            string result = client.DownloadString("http://1212.ip138.com/ic.asp");
            Console.WriteLine(result);

            Console.WriteLine();
            Console.WriteLine("OVER");
            Console.ReadLine();
        }

  注:免费代理来源: 百度“http代理”。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM