获取计算名 string hostname = Environment.MachineName;; 获取ip地址 System.Net.IPHostEntry myEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); string ipAddress = myEntry.AddressList[0].ToString();