280 //通过Win32_BaseBoard获取主板信息,但不是所有的主板都有编号,或者说不是能获取所有系统主板的编号。 281 282 //通过Win32_PhysicalMedia获取硬盘编号应该没有问题。但网上说可以通过Win32_DiskDrive获取,其实所得信息根本不包含SerialNumber。 283 284 //通过Win32_BIOS获取BIOS信息,基本和获取主板信息差不多。
IEnumWbemClassObject* pEnumerator = NULL; hres = pSvc->ExecQuery(BSTR(L"WQL"), BSTR(L"SELECT * FROM Win32_DiskDrive"), WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator); if (FAILED(hres)) { printf("Query for disk drives failed. Error code = 0x%X ",...
厂商名称(manufacturer)一般都只存在默认值。型号可以详细获得,比如WDC WD1600AAJS-75B4A0.using System.Management;ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from " + Key);用下面的key Win32_DiskDrive 参考资料:http://www.codeproject.com/KB/system/GetHardwareInf...
;varallPDisks = Session.QueryInstances(@"root\cimv2","WQL","SELECT * FROM Win32_DiskDrive");// Loop through all volumesforeach(CimInstance oneVolumeinallVolumes) {// Show volume informationif(oneVolume.CimInstanceProperties["DriveLetter"].ToString()[0] >' ') { Console.WriteLine("Vol...
ManagementClass mc=newManagementClass("Win32_DiskDrive"); ManagementObjectCollection moc=mc.GetInstances();foreach(ManagementObject moinmoc) {//HDid =(string)mo.Properties["Model"].ToString();HDid = (String)mo.Properties["Model"].Value.ToString(); ...
foreach(ManagementObject moinmoc) { cpuInfo=mo.Properties["ProcessorId"].Value.ToString(); Response.Write ("cpu序列号:"+cpuInfo.ToString ()); } //获取硬盘ID String HDid; ManagementClass cimobject1=newManagementClass("Win32_DiskDrive");
(L"SELECT * FROM Win32_PhysicalMemory",L"SerialNumber",RefBuffer);std::cout<<"获取内存序列号: "<<RefBuffer<<std::endl;Trims(RefBuffer);ref=SelectQuerySQL(L"SELECT * FROM Win32_DiskDrive WHERE Index = 0",L"SerialNumber",RefBuffer);Trims(RefBuffer);std::cout<<"获取硬盘序列号: "<<...
•获取CPU编号:Dim mc As New ManagementClass("Win32_Processor")Dim moc As ManagementObjectCollection = mc.GetInstances()Dim strID As String = Nothing For Each mo As ManagementObject In moc strID = mo.Properties("ProcessorId").Value.ToString()Exit For Next textBox1.Text += "CPU ID:" + ...
WMI查询Win32_DiskDrive,试图寻找“VBOXHARDDISK”、”QEMU HARDDISK”、”VMWARE VIRTUAL IDE HARD DRIVE”、“VMware Virtual SSCSI Disk Device” WMI查询Win32_BIOS,试图寻找“VboxBIOS version” WMI查询Win32_Baseboard,试图寻找“VMware-stylemotherboard”、“440BX Desktop Reference Platform”,名称=”Base Boa...
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_DiskDrive"); foreach (ManagementObject queryObj in searcher.Get()) { Console.WriteLine("PNPDeviceID: {0}", queryObj["PNPDeviceID"]); } 更新: 如果是 CD,则 PNPDeviceID 可能是可能的,但如果...