如何获得INTEL系列CPU序列号?
//取得IntelCPU的ID号:voidIntelCPUIDDlg::OnButtonCPUID()
{
unsignedlongs1,s2;
unsignedcharvendor_id[]="------------------";
CStringstr1,str2,str3;
__asm
{
xoreax,eax
cpuid
movdwordptrvendor_id,ebx
movdwordptrvendor_id[+4],edx
movdwordptrvendor_id[+8],ecx
}
str1.Format("%s",vendor_id);
__asm//取得CPUID的高32位
{
moveax,01h
xoredx,edx
cpuid
movs2,eax
}
str2.Format("%08X-",s2);
__asm//取得CPUID的低64位
{
moveax,03h
xorecx,ecx
xoredx,edx
cpuid
movs1,edx
movs2,ecx
}
str3.Format("%08X-%08X/n",s1,s2);
str2+=str3;
m_editVendor.SetWindowText(str1);
m_editCPUID.SetWindowText(str2);
}
本文地址:http://www.45fan.com/dnjc/72015.html