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