Pergunta

How can I get a device group or the network devices that shows the Device Manager window without WMI? I tried with devcon but returns all nics.

For example, devcon returns:

enter image description here

and I just want these one (without the show hidden devices option)

enter image description here

Any kind of solution for devcon or net framework 2, idea or workaround will be treated as solution if its works.

Foi útil?

Solução

To list the network adapters you can use the GetAdaptersInfo WinAPi function, since you are using .Net try the PInvoke page for a sample.

Outras dicas

Try System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces(). It returns a collection of all detected network interfaces. You can then filter it down to the interfaces whose operational status is "Up", and/or that have valid IP interface properties (such as a defined IPv4/IPv6 address)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top