using System.Net;
using System.Net.Socket;
IPHostEntry MyIPHostEntry = Dns.GetHostByAddress(.....)
IPHostEntry MyIPHostEntry = Dns.GetHostByName(.....)
IpHostEntry里面有AddressList属性可以用,比如IpHostEntry.AddressList[0]就得到一个IP地址(即IPAddress实例)
IPHostEntry里面还有HostName属性(既主机名称)