unit1.pas

来自「CPU 序列号」· PAS 代码 · 共 54 行

PAS
54
字号
unit Unit1; //CPUID

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function getcpuid:string;
  function cpuid:longint;assembler;register;
  var
    temp:longint;
  begin
    asm
      push ebx
      push edi
      mov  edi,eax
      mov  eax,1
      dw   $a20f
      mov  temp,edx
      pop  edi
      pop  ebx
    end;
    result:=temp;
  end;
begin
  result:=inttohex(cpuid,8);
end;



procedure TForm1.FormCreate(Sender: TObject);
begin
     Label1.Caption:='本机的 CPU_ID:   “ '+getcpuid+' ”';
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?