如何找到所有图形卡? C#
How to find All Graphic Cards? C#
我使用此代码查找显卡:
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();
}
}
}
但结果是:Nvidia Quadro K6000
如何找到所有显卡?
the MSDN page 的第一行是:
[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.]
所以我建议你从 Win32_VideoController 开始。
我使用此代码查找显卡:
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();
}
}
}
但结果是:Nvidia Quadro K6000
如何找到所有显卡?
the MSDN page 的第一行是:
[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.]
所以我建议你从 Win32_VideoController 开始。