//获得操作系统的序列号
uses Registry;
procedure TForm1.Button1Click(Sender: TObject);//Windows XP有效
var
reg: TRegistry;
result:string;
begin
Result := '';
reg := TRegistry.Create; //生成注册表对象
with reg do
begin
RootKey := HKEY_LOCAL_MACHINE;
OpenKey('Software\Microsoft\Windows\CurrentVersion', False);//打开注册表
Result := ReadString('ProductID'); //得到序列号
end;
reg.Free;
Self.caption:=result; //显示序列号
end;