Search code examples
c#graphicsnvidiadiagnosticsvga

How to find All Graphic Cards?


I used this code for finding graphic cards:

ManagementObjectSearcher searcher = 
               new ManagementObjectSearcher("SELECT * FROM Win32_DisplayConfiguration");

string graphicsCard = "";
foreach (ManagementObject mo in searcher.Get())
{
   foreach (PropertyData property in mo.Properties)
   {
      if (property.Name == "Description")
      {
        graphicsCard += property.Value.ToString();
      }
   }
}

My Graphic Cards

but result is: Nvidia Quadro K6000

How to find all Graphic cards?


Solution

  • The very first line of the MSDN page reads:

    [The Win32_DisplayConfiguration WMI class is no longer available for use as of Windows Server 2008. Instead, use the properties in the Win32_VideoController, Win32_DesktopMonitor, and CIM_VideoControllerResolution classes.]

    So I suggest you start out with Win32_VideoController.