Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
2.18/5 (3 votes)
See more:
I want to get the device name that connected through the network interface card (LAN) like the image below.

You can see the device name in the red border

Image
Posted

1 solution

You can get this information from WMI.

For XP, Vista, Seven: Win32_NetworkAdapter class[^]
Since 8, 8.1, Server 2012: MSFT_NetAdapter class[^]
For both of these classes, the property you are interested in is 'Status'.

Here you can have a clue about how to use WMI classes from C#:
Sample C# code for using the latest WMI classes to manage Windows Storage[^]
You just have to change the scope and adapt the query.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900