NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface adapter in adapters) { IPInterfaceProperties adapterProperties = adapter.GetIPProperties(); IPAddressCollection dnsServers = adapterProperties.DnsAddresses; if (dnsServers.Count > 0) { Console.WriteLine("Adapter Id .... : " + adapter.Id); Console.WriteLine("Adapter Description .... : " + adapter.Description); Console.WriteLine("Adapter Name .... : " + adapter.Name); Console.WriteLine("Network Interface Type .... : " + adapter.NetworkInterfaceType.ToString()); Console.WriteLine("Adapter Speed .... : " + adapter.Speed); Console.WriteLine("OperationalStatus .... : " + adapter.OperationalStatus); Console.WriteLine("Adapter SupportsMulticast .... : " + adapter.SupportsMulticast); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)