我是否可以从完全限定的名称(可以有或没有域名)中获得简单的计算机名称(不带域名)?计算机名可以有点(.)吗?签个名?
发布于 2012-02-24 19:32:33
发布于 2012-02-24 19:39:55
从fqdn中:
string s = "some.computer.name";
string host = s.Substring(0, s.IndexOf('.'));在框架之外:
System.Net.Dns.GetHostName();https://stackoverflow.com/questions/9429992
复制相似问题