using System;
using System.Net;using System.Text.RegularExpressions;namespace Keleyi.Com{ public class GetInternetIP { public static string GetIP() { using (var webClient = new WebClient()) { try { var ip = Regex.Match(temp, @"\[(?<ip>\d+\.\d+\.\d+\.\d+)]").Groups["ip"].Value; return !string.IsNullOrEmpty(ip) ? ip : null; } catch (Exception ex) { return ex.Message; } } } }}
快乐而轻松的写代码
浙公网安备 33010602011771号