Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find All Graphic Cards? C#

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?

like image 971
Mohammad Avatar asked Feb 07 '23 21:02

Mohammad


1 Answers

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.

like image 150
nvoigt Avatar answered Feb 09 '23 11:02

nvoigt