delphi 操作注册表

uses Registry;


procedure TfrmLogin.FormShow(Sender: TObject);
var
  reg: TRegistry;
begin
  Reg := TRegistry.Create;
  Reg.RootKey := HKEY_CURRENT_USER;
  Reg.OpenKey('\SOFTWARE\Employees\', true);
  if not reg.ValueExists('User') then
    Reg.WriteString('User', 'UserID')
  else
    edtuser.Text := Reg.ReadString('User');
  Reg.Free;
end;

你可能感兴趣的:(Delphi,Registry,操作注册表)