using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Management; using System.Text; namespace WindowsApplication2 ... { /**//**//**//**//**//**//**//// <summary> /// Form1 的摘要说明。 /// </summary> public class Form1 : System.Windows.Forms.Form ...{ private System.Windows.Forms.ListView listView1; private System.Windows.Forms.ColumnHeader name; private System.Windows.Forms.ColumnHeader caption; private System.Windows.Forms.ColumnHeader desc; private System.Windows.Forms.MenuItem menuItem1; /**//**//**//**//**//**//**//// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.Container components = null; public Form1() ...{ // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // this.getnetwork(); this.getvideo(); this.getsound(); this.getcpu(); this.getmemory(); this.getmainboard(); } //得到硬件的信息集合 public ManagementObject dosth(string[] hstra) ...{ string hname=hstra[0]; ManagementObjectSearcher query = new ManagementObjectSearcher(hstra[1]); ManagementObjectCollection qc = query.Get(); foreach( ManagementObject obj in qc) ...{ switch(hname) ...{ case "网卡": if((bool)obj["ipEnabled"]==false) continue; //this.getallinfo(obj);