Registriert seit: 11. Mai 2005
Ort: Göppingen
1.238 Beiträge
Delphi 2007 Professional
|
Re: Registry - Informationen Schreiben und lesen...
9. Mai 2006, 16:43
Delphi-Quellcode:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,registry, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey(' Software\Meine Software\', True);
Reg.WriteString(' Eintrag', ' Wert');
Reg.CloseKey;
finally
Reg.Free;
end;
end;
procedure TForm2.Button2Click(Sender: TObject);
var
Reg: TRegistry;
s: String;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey(' Software\Meine Software\', True);
s := Reg.ReadString(' Eintrag');
showmessage(s);
Reg.CloseKey;
finally
Reg.Free;
end;
end;
end.
Noch etwas für die Zukunft kann ja in die CL.
Mfg
Tobias It's not a bug, it's a feature.
|
|
Zitat
|