HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://ip-api.com/json");
WebProxy proxy = new WebProxy("209.205.2.1", 444);
proxy.Credentials = new NetworkCredential("xiexibi123", "0b8487-516e1e-9826a1-b091c8-a449123");
request.Proxy = proxy;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream stream = response.GetResponseStream();//获得回应的数据流
//将数据流转成 String
string result = new StreamReader(stream, System.Text.Encoding.UTF8).ReadToEnd();
textBox1.Text = result;
以上代码 当程序运行起来时 每次执行 都会得到相同的IP
当程序重新启动以后 再次执行 就会得到新的IP
求高手解答 如何控制每次访问web的IP
1条回答
查看更多
0人赞
添加讨论(0)
举报
相关问题
- POST Base64 encoded data in PHP
- java httpRequest getRemoteAddr allways return 127.
- HttpContent.ReadAsByteArrayAsync() fails without e
- How can I start another request after AbortControl
- Volley Bug: Repeating a request when verbose loggi
相关文章
- What is the difference between HTTP parameters and
- “Content type 'application/json;charset=UTF-8&
- How to display response in next activity
- Using Httprequest to get pictures from given URL
- Add HEADER in HTTP Request in Java
- Choosing between package:html, dart:html, dart:io
- Mailgun + AngularJS + Auhtentication for http post
- Protractor: HTTP Response Testing