Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class cCHID
- {
- public static string GetCHID()
- {
- string CHID = "";
- ManagementObjectSearcher searcher;
- //processor
- searcher = new ManagementObjectSearcher("root\\CIMV2",
- "SELECT * FROM Win32_Processor");
- foreach (ManagementObject queryObj in searcher.Get())
- CHID = CHID + queryObj["ProcessorId"].ToString() + "_";
- //mainboard id
- searcher = new ManagementObjectSearcher("root\\CIMV2",
- "SELECT * FROM CIM_Card");
- foreach (ManagementObject queryObj in searcher.Get())
- CHID = CHID + queryObj["SerialNumber"].ToString() + "_";
- //OS serial number
- searcher = new ManagementObjectSearcher("root\\CIMV2",
- "SELECT * FROM CIM_OperatingSystem");
- foreach (ManagementObject queryObj in searcher.Get())
- CHID = CHID + queryObj["SerialNumber"].ToString();
- return CHID;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement