Home > OS >  C # how to list all the monitor name
C # how to list all the monitor name

Time:10-08

My computer took the 2 display, monitor equipment management also has 2 below, but according to the following two methods can only display a, according to????????
What is the method to monitor the list of all the display ~

ManagementObjectCollection moc2=MC2. GetInstances ();
Foreach (ManagementObject mo2 in moc2)
{
//MessageBox. Show (moc2. Count. The ToString ());
//MessageBox. Show (mo2. Properties [r]. "Description" Value. The ToString ());
Of state Richard armitage ppendLine (" display type: : "+ mo2. Properties [r]." Description "Value. The ToString ());
}
Moc2=null;
MC2=null;

String query="Select MonitorType from Win32_DesktopMonitor";
Using (ManagementObjectSearcher searcher=new ManagementObjectSearcher (query))
{
Foreach (ManagementObject mo in a searcher. The Get ())
{
MessageBox. Show (" display type: "+ mo [r]." MonitorType "ToString () +" \ r \ n number of display: "+ a searcher. The Get () Count. The ToString ());
}
}
  • Related