如何查找所有图形卡? C#

时间:2016-05-30 08:47:39

标签: c# graphics nvidia diagnostics vga

我使用此代码查找图形卡:

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

但结果是:Nvidia Quadro K6000

如何查找所有图形卡?

1 个答案:

答案 0 :(得分:7)

the MSDN page的第一行是:

  

[自Windows Server 2008起,Win32_DisplayConfiguration WMI类不再可用。而是使用Win32_VideoController,Win32_DesktopMonitor和CIM_VideoControllerResolution类中的属性。]

所以我建议你从Win32_VideoController开始。