I am using NetworkInformation namespace to list all the network devices.
NetworkInterface.GetAllNetworkInterfaces();
When I get the list, there are some weird unknown devices:

What are they? And should I, and if, then how, get rid of them? In theory it should show only Local Area Connection and Wireless Connection. Under Network Connections I can't find anything like that installed either.
Windows has network 'devices' that don't exist in terms of physical hardware - they're used for various things, such as VPN connections (like that tunneling pseudo interface) and the loopback adapter, which is what responds to 127.0.0.1
You can parse the non-physical addresses by using WMI to query the list of adapters instead,
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(new SelectQuery("Win32_NetworkAdapter")))
{
foreach (ManagementObject mo in searcher.Get())
{
if ((bool)mo["PhysicalAdapter"])
Console.WriteLine(mo["Name"]);
}
}
(taken from MSDN)
That'll only return physical devices, as you're casting the true/false value of the PhysicalAdapter property as bool.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With