实现效果:

  获取显示设备的名称及PNPDeviceID_ide

知识运用:

  ManagementObjectSearcher类和ManagementObject类

实现代码:

        private void button1_Click(object sender, EventArgs e)
        {
            ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController");
            foreach (ManagementObject FlashDeviceObject in searcher.Get())
            {
                textBox1.Text = FlashDeviceObject["Name"].ToString();
                textBox2.Text = FlashDeviceObject["PNPDeviceID"].ToString();
            }
        }