using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Management;
namespace WMI信息
...{
public partial class Form1 : Form
...{
public Form1()
...{
InitializeComponent();
}
private void getInfomation_Click(object sender, EventArgs e)//getInfomation为Button
...{
try
...{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\CIMV2", "SELECT * FROM Win32_VideoController");
foreach (ManagementObject info in searcher.Get())
...{
string[] item1 = ...{ "AdapterCompatibility", info["AdapterCompatibility"].ToString() };
listView1.Items.Add(new ListViewItem(item1));