- private
- static
- string
- GetIP()
- {
- HttpHelper
- http = new
- HttpHelper();
- HttpItem
- item = new
- HttpItem()
- {
- URL
- = "http://www.ip138.com/ips138.asp"
- };
- HttpResult
- result = http.GetHtml(item);
- string
- html = result.Html;
- string
- ip = Regex.Match(html, @"您的IP地址是:\[(\d{1,4}\.\d{1,4}\.\d{1,4}\.\d{1,4})\]").Groups[1].Value.ToString();
-
- return
- ip;
- }
复制代码
|
|