工具类
获取IP
IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName()); var ippaddress = host .AddressList .FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork);