C#获取 NetBIOS和 DNS计算机名
static string GetLocalHostName () { string netBiosName = System.Environment.MachineName; //return netBiosName; // Following method is deprecated // string dnsName = // System.Net.Dns.GetHostByName("LocalHost").HostName; string dnsName = System.Net.Dns.GetHostName(); return dnsName; }