代码如下:public static IPAddress GetHostIP(){ IPHostEntry ipe = Dns.GetHostEntry(Dns.GetHostName()); IPAddress ip = ipe.AddressList[0]; return ip;} private String GetIPAddress(){ String str; String Result = “”; String hostName = Dns.GetH