I need to query the Hardware-Id for a network adapter using C#.
Using the System.Management i can query the details of deviceID,description etc. but not the hardware id.
where, listBox1 is a simple listbox control instance for showing the items on a winform app.
For ex:
ManagementObjectCollection mbsList = null;
ManagementObjectSearcher mbs = new ManagementObjectSearcher("Select * From Win32_NetworkAdapter");
mbsList = mbs.Get();
foreach (ManagementObject mo in mbsList)
{
listBox1.Items.Add("Name : " + mo["Name"].ToString());
listBox1.Items.Add("DeviceID : " + mo["DeviceID"].ToString());
listBox1.Items.Add("Description : " + mo["Description"].ToString());
}
However looking at MSDN WMI reference there is no way i can get the HardwareId. By using the devcon tool (devcon hwids =net) however i know that each device is associated with a HardwareId
Any help is deeply appreciated