public static HostNetInfo ForThisHost() { var computerProps = IPGlobalProperties.GetIPGlobalProperties(); var result = new HostNetInfo { m_Name = "{0}.{1}".Args(computerProps.HostName, computerProps.DomainName), m_HostNameSegment = computerProps.HostName, m_DomainNameSegment = computerProps.DomainName }; var adapters = new OrderedRegistry <NetAdapterInfo>(); var nics = NetworkInterface.GetAllNetworkInterfaces(); var ord = 0; foreach (var nic in nics) { adapters.Register(new NetAdapterInfo(nic, ord)); ord++; } result.m_Adapters = adapters; return(result); }
public static HostNetInfo ForThisHost() { var computerProps = IPGlobalProperties.GetIPGlobalProperties(); var result = new HostNetInfo { m_Name = "{0}.{1}".Args(computerProps.HostName, computerProps.DomainName), m_HostNameSegment = computerProps.HostName, m_DomainNameSegment = computerProps.DomainName }; var adapters = new OrderedRegistry<NetAdapterInfo>(); var nics = NetworkInterface.GetAllNetworkInterfaces(); var ord = 0; foreach(var nic in nics) { adapters.Register( new NetAdapterInfo(nic, ord) ); ord++; } result.m_Adapters = adapters; return result; }