Jitesh Byahut 2/16/2014 3156

Win32_DesktopMonitor in WMI C# Asp.Net

Here we are retrieving Desktop monitor details of Computer.

Use namespace System.Management

using System.Management;

 

public partial class Win_Win32_DesktopMonitor : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

 ManagementObjectSearcher objdesk = new ManagementObjectSearcher("select * from Win32_DesktopMonitor");

 

        foreach (ManagementObject obj in objdesk.Get())

        {

            Response.Write("Name  -  " + obj["Name"] + "</br>");

            Response.Write("DeviceID  -  " + obj["DeviceID"] + "</br>");

            Response.Write("Caption  -  " + obj["Caption"] + "</br>");

            Response.Write("Description  -  " + obj["Description"] + "</br>");

            Response.Write("MonitorManufacturer  -  " + obj["MonitorManufacturer"] + "</br>");

            Response.Write("MonitorType  -  " + obj["MonitorType"] + "</br>");

            Response.Write("ScreenHeight  -  " + obj["ScreenHeight"] + "</br>");

            Response.Write("ScreenWidth  -  " + obj["ScreenWidth"] + "</br>");

            Response.Write("ConfigManagerErrorCode  -  " + obj["ConfigManagerErrorCode"] + "</br>");

        }

    }

}

Demo

View output :

demoimage


Please give your feedback for improving this page