tags:

views:

14

answers:

1

I am using the following code to get some info about my PCIController

    try
    {
        ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from Win32_PCIController");
        foreach (ManagementObject cdrom in searcher.Get())
        {
            Console.WriteLine("PCIController Name: {0}", cdrom.GetPropertyValue("Caption"));
        }
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

But it kept throwing "Invalid Class" exception. And I run my query with "wbemtest.exe" tool which is installed with Windows, and the same error there is. I checked the CIM_PCIController Class on MSDN and it seems my code is ok. But why the "Invalid Class exception"? Could someone help me, I just want to get some info from my PCI Controller device.

Many thanks.

A: 

From the documentation page you cited:

WMI does not implement this class.

This means it is not available through the WMI. That being said you might be able to go through the Win32_PnPEntity stuff to find what you are looking for.

Jack B Nimble