I am building a simple program that when it is ran it will show different computer components.
Right now I am trying to show all monitors plugged in. The name of each and the total amount plugged into the computer.
When I run the below code, It only shows me the name of one monitor even though I am plugged into three. Could someone please tell me why.
public static List<string> GetMonitorNames()
{
ManagementClass mc = new ManagementClass("Win32_DesktopMonitor");
ManagementObjectCollection moc = mc.GetInstances();
var info = new List<string>();
foreach (ManagementObject mo in moc)
{
info.Add(mo["Name"].ToString());
}
return info;
}