1. 程式人生 > >C# WebClient 使用http免費代理

C# WebClient 使用http免費代理

encoding proxy sed true code class http asp enc

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免費代理