I am using the code below to get a unique CPU ID, i found various samples on the web using this. However. By chance I happen to own 2 Asus Laptops. One is a quad core i5 the other an heavy duty i7 octocore both are 64 bit machines.. To my big surprise they both produce the same "unique" CPU ID ???.
So this code isnt working for me, are there other methods to get unique CPU ids or do i do something wrong here. What I hope to get is a number that specific for each CPU that is made
string cpuID = string.Empty;
ManagementClass mc = new ManagementClass("win32_processor");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
if (cpuID == "")
{
//Remark gets only the first CPU ID
cpuID = mo.Properties["processorID"].Value.ToString();
}
}
return cpuID;
try
ManagementClass managClass = new ManagementClass("win32_processor");
ManagementObjectCollection managCollec = managClass.GetInstances();
foreach (ManagementObject managObj in managCollec)
{
cpuInfo = managObj.Properties["processorID"].Value.ToString();
break;
}
working fine here...
Maybe the UUID property of the Win32_ComputerSystemProduct object will suit your needs. It is supposed to be unique per-motherboard, as long as the manufacturer configures it in the first place. It's not too common for the CPU to move around without the motherboard coming along for the ride, anyways.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With