2014-03-31 114 views
0

什么是设备的最独特的ID以及如何使用C#中的ManagementObjectCollection检索它?检索唯一设备ID

using (var searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PnPEntity")) 
       collection = searcher.Get(); 

foreach (var valueString in from mo in collection.Cast<ManagementObject>()... 

预先感谢您!

回答

1

只需从管理对象中获取"DeviceID"-property即可。