码迷,mamicode.com
首页 > Windows程序 > 详细

C# WebClient 使用http免费代理

时间:2017-08-01 15:41:58      阅读:333      评论:0      收藏:0      [点我收藏+]

标签:line   logs   read   webp   []   c#   adl   使用   log   

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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();
        }

 

C# WebClient 使用http免费代理

标签:line   logs   read   webp   []   c#   adl   使用   log   

原文地址:http://www.cnblogs.com/sanler/p/7268628.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!