日期:2014-05-18 浏览次数:20413 次
public string GetDiskID() { String HDid = null; ManagementClass cimobject1 = new ManagementClass("Win32_DiskDrive"); ManagementObjectCollection moc1 = cimobject1.GetInstances(); foreach (ManagementObject mo in moc1) { HDid = mo.Properties["Model"].Value as string; foreach (PropertyData var in mo.Properties) { Console.WriteLine("属性名: "+var.Name+"值: "+var.Value); } }