0

I am making my own hardware monitor like CPU-Z, I am trying to acquire my dedicated graphics card information, but it only returns my processors integrated graphics.

public string GetPart(string part)
        {
            ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM " + "Win32_Videocontroller");
            foreach (ManagementObject mobj in searcher.Get())
            {
                partval = mobj["Name"] as string;
            }
            return partval;

This returns Intel(R) UHD Graphics 630

For other applicable parts like hard drive, fans, or even the rare case of multiple processor sockets, how would I go about indexing these?

I have had some problems with this laptop revolving around my gpu, it could be possible that it 'isn't detected' as Task Manager does not show GPU1 ever being used, and the performance tab shows absurdly low usage even when running a game like WoW on max settings, especially on a laptop.

Quivic
  • 1
  • 3
  • You're asking for just the name of one of the Video controllers. `Win32_Videocontroller` has many other properties. See also the Win32_Processor class, for example. Or outside the `CIMV2` path, the `WMI` path. In `root\WMI` you have, for example, `MSAcpi_ThermalZoneTemperature`, which returns the CPUs temperature in real time, etc. You have to rummage the WMI underwood. Get the [WMI Code Creator](https://www.microsoft.com/en-us/download/confirmation.aspx?id=8572) (or a third-party equivalent: you can find some quite good open source implementations). – Jimi Jun 05 '19 at 08:16
  • I'm well aware, thats why im asking how I would retrieve the name of either a specific one or multiple from a device. – Quivic Jun 05 '19 at 18:47
  • Well, here you're looping the `ManagementObject` results, but you only assign a single string. If you had more that one adapter, you'll just retrieve the name of the last one. See here an implementation, returning USB drives informations (includes generic methods that apply to any `ManagementObject` query): [Get serial number of usb storage device in .net core 2.1](https://stackoverflow.com/a/51806262/7444103). – Jimi Jun 05 '19 at 22:15

0 Answers0