VC++获取CPUID

转自:https://blog.csdn.net/WU9797/article/details/81209531

主要用到获取CPU ID值的汇编指令:


  
  
  1. CString CGetCPUIDDlg::GetCPUID()
  2. {
  3. CString strCPUID;
  4. unsigned long s1, s2;
  5. __asm{
  6. mov eax, 01h
  7. xor edx, edx
  8. cpuid
  9. mov s1, edx
  10. mov s2, eax
  11. }
  12. strCPUID.Format( "%08X%08X", s1, s2);
  13. return strCPUID;
  14. }

猜你喜欢

转载自blog.csdn.net/networmrlc/article/details/86547451