[Original] verify whether the proxy IP is useful, the original proxy ip

Source: Internet
Author: User

[Original] verify whether the proxy IP is useful, the original proxy ip

/// <Summary> /// verify whether the proxy IP address is useful /// </summary> /// <param name = "ip"> IP address </param> /// <param name = "port"> port number </param> // <returns> returns true </returns> static bool IsEnabled (string ip, int port) {try {HttpWebRequest Req = (HttpWebRequest) WebRequest. create (" http://www.whatismyip.com.tw/ "); WebProxy proxyObject = new WebProxy (ip, port); // ip address, port number Req. proxy = proxyObject; // sets Proxy Req. userAgent = "Mozilla/5.0 (Windows NT 6.1; rv: 31.0) Gecko/20100101 Firefox/31.0"; HttpWebResponse Resp = (HttpWebResponse) Req. getResponse (); Encoding code = Encoding. getEncoding ("UTF-8"); using (StreamReader sr = new StreamReader (Resp. getResponseStream (), code) {if (sr! = Null) {string strHtml = sr. ReadToEnd (); MatchCollection mc = Regex. Matches (strHtml, "

 


How to verify whether the proxy IP address is valid

Open IE. Enter www.ip138.com to display your Internet IP address ..

Proxy IP Verification

One by one.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.