Because the IP address is a change, so we need to automatically get to the extranet IP, and then I wrote a code from the move to get to the extranet IP, it does not need each handwriting, it is more convenient.
Using System;
Using System.Net;
Using System.Text.RegularExpressions;
Namespace ConsoleApplication1 {class Program {static void Main (string[] args) {try
{WebClient client = new WebClient (); Client.
Encoding = System.Text.Encoding.Default; String response = client.
Uploadstring ("http://iframe.ip138.com/ipcity.asp", "");
Match MC = Regex.match (Response, @ "location.href=" "(. *)" ""); if (MC. Success && MC. Groups.count > 1) {response = client. Uploadstring (MC. GROUPS[1].
Value, ""); string[] str1 = response.
Split (' [');
Response = str1[1]; string [] str = response.
Split ('] ');
Response = str[0];
Console.Write (response);
The catch (System.Exception e) {} Console.read ();
}
}
}
Results: