Enumerating network adaptors

  • Thread starter Thread starter Sid Price
  • Start date Start date
S

Sid Price

I need to enumerate all the network adaptors in a PC and their IP addresses.
I have tried with WMI but I do not seem able to figure out from the several
adaptors in the system which are active and connected to a network.

Any suggestions would be much appreciated.

I am using VS2005 (VB) and .NET 2.0.

Thank you,
Sid.
 
Hello Sid,

take a look at the System.Net.NetworkInformation.NetworkInterface class.

It has a GetAllNetworkInterfaces static method which returns the infos you
need.

And then there is the IPGlobalProperties class.

Kind regards,
Henning Krause
 
Hello Henning,

Many thanks for the excellent advice on the two classes to examine. After
studying the documentation of them and the classes they use I was able to
resolve the issue of finding the IP addresses of the active network
connections.

Thank you,
Sid.
 
Back
Top