请问怎么获得CPU的ID呢,是在CPU上刻着的那种,不是要什么奔腾几,赛扬了,Athlon,计算速度了什么的,不是这些,是CPU在全球的唯一ID,每个CPU都有唯一的编号。Intel的CPU ID和AMD的CPU ID都需要获得,请问该怎么做呢。如果需要嵌入汇编,那汇编代码是什么,在VC中怎么嵌入呢谢谢了,另开帖子给分!

解决方案 »

  1.   

    好象WINDOWS优化大师能做到,你可以发个MAIL问下,碰运气
      

  2.   

    __asm
    {
    xor eax,eax

    CPUID
    mov rEax,eax
    }
      

  3.   

    http://www.pcvc.net/category/content.asp?sendid=259
      

  4.   

    无法获得可以获得序列号的只是早期的P3,还要看主板CPUID指的是通过CPUID指令获取的一些关于CPU本身的一些信息,同一厂商同一型号CPU的ID完全相同
      

  5.   

    不是吧?我机器用CPUID没问题的。
      

  6.   

    我用CPUID获得的是
    GenuineIntel-0383F9FF
    00000686-0C040841-00000000
    但我拿出CPU看了看上面写的是Q104A350-0139 SL4P6
    我用了WMI也不行,出来的是:
    0383F9FF00000686
      

  7.   

    只要是全球唯一ID的就行,因为我需要识别机器,不是做加密,是测试机器变更用的,还有,AMD的怎么得到呢
      

  8.   

    MSDN2003:
    Win32_Processor
    The Win32_Processor WMI class represents a device that can interpret a sequence of machine instructions on a computer running a Windows® operating system. On a multiprocessor machine, one instance of the Win32_Processor class exists for each processor.The following syntax is simplified from Managed Object Format (MOF) code and includes all inherited properties.
    class  Win32_Processor : CIM_Processor
    {
      uint16 AddressWidth;
      uint16 Architecture;
      uint16 Availability;
      string Caption;
      uint32 ConfigManagerErrorCode;
      boolean ConfigManagerUserConfig;
      uint16 CpuStatus;
      string CreationClassName;
      uint32 CurrentClockSpeed;
      uint16 CurrentVoltage;
      uint16 DataWidth;
      string Description;
      string DeviceID;
      boolean ErrorCleared;
      string ErrorDescription;
      uint32 ExtClock;
      uint16 Family;
      datetime InstallDate;
      uint32 L2CacheSize;
      uint32 L2CacheSpeed;
      uint32 LastErrorCode;
      uint16 Level;
      uint16 LoadPercentage;
      string Manufacturer;
      uint32 MaxClockSpeed;
      string Name;
      string OtherFamilyDescription;
      string PNPDeviceID;
      uint16 PowerManagementCapabilities[];
      boolean PowerManagementSupported;
      string ProcessorId;
    //ProcessorId :注意这和下面的 UniqueId;Data type: string
    Access type: Read-only Processor information that describes the processor features. For an x86 class CPU, the field format depends on the processor support of the CPUID instruction. If the instruction is supported, the property contains 2 (two) DWORD formatted values. The first is an offset of 08h-0Bh, which is the EAX value that a CPUID instruction returns with input EAX set to 1. The second is an offset of 0Ch-0Fh, which is the EDX value that the instruction returns. Only the first two bytes of the property are significant and contain the contents of the DX register at CPU reset—all others are set to 0 (zero), and the contents are in DWORD format.
      uint16 ProcessorType;
      uint16 Revision;
      string Role;
      string SocketDesignation;
      string Status;
      uint16 StatusInfo;
      string Stepping;
      string SystemCreationClassName;
      string SystemName;
      string UniqueId;
    //UniqueId 
    Data type: string
    Access type: Read-only Globally unique identifier for the processor. This identifier may only be unique within a processor family. This property is inherited from CIM_Processor.
      uint16 UpgradeMethod;
      string Version;
      uint32 VoltageCaps;
    };
    Methods
    The Win32_Processor class defines the following methods.Method Description 
    Reset Not implemented. 
    SetPowerState Not implemented. Properties
    The Win32_Processor class defines the following properties.