Breaking News
Loading...
Wednesday 13 March 2013

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@\/  <(.'.)>

0 comments:

Post a Comment

Thanks for comment

 
Toggle Footer