Getting my screen name in c #
4 answers
I think you want the Win32_DesktopMonitor class from the System.Management namespace. I'm not sure which property you want, but try something like this to see what you get:
SelectQuery q = new SelectQuery("SELECT Name, DeviceID, Description FROM Win32_DesktopMonitor");
using(ManagementObjectSearcher mos = new ManagementObjectSearcher(q))
{
foreach(ManagementObject mo in mos.Get())
{
Console.WriteLine("{0}, {1}, {2}",
mo.Properties["Name"].Value.ToString(),
mo.Properties["DeviceID"].Value.ToString(),
mo.Properties["Description"].Value.ToString());
}
}
You can filter by specific device ID if you like with a simple WHERE DeviceID = 'sausage' clause in SQL. Although perhaps with less sausage.
+5
source to share
Have you tried the DeviceName property? I think I would do Screen.getPrimaryScreen (). DeviceName
http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.devicename.aspx
0
source to share
I think you might need to use WMI for this. Here is a link fooobar.com/questions/1701909 / ... . Basically you go for something like Win32_DesktopMonitor .
0
source to share