I am trying to get the system device IDs from the device manager, in C#. I found some code to find the USB device ID, but I don't know how to change the code from USB device to PCI device.
This is the code that I found:
ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_SystemDevices WHERE InterfaceType='USB'");
foreach (ManagementObject mo in mos.Get())
{
ManagementObject query = new ManagementObject("Win32_PhysicalMedia.Tag='" + mo["DeviceID"] + "'");
Console.WriteLine(query["SerialNumber"]);
}