How to Get monitor detail using C#.net,How to get information monitor of computer using C#.net

For getting information about Monitor of your computer follow step:
1)  Add reference "System.Management"
          (For showing how to add reference click here)
2)  Add name space
                 using System.Management;

/////////////////   CODE   /////////////////////
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Management;

namespace MonitorInfoCSharp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ManagementObjectSearcher mosDesktop = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_DesktopMonitor");

            foreach (ManagementObject moDesktop in mosDesktop.Get())
            {
                if (moDesktop["Description"] != null)
                    MessageBox.Show( moDesktop["Description"].ToString());

            }
        }
    }
}


/////////////////////////////////////////////////////////////////

Download Code : MonitorCsharp.rar

See Also :
Follow Me On Facebook
--
/\/ir@\/  <(.'.)>

Comments

Popular posts from this blog

How to get column value from the selected row in data grid in wpf c#.net

How to make and use web service in Microsoft Dynamics Navision.

How to use Format function in Microsoft Dynamics Navision.