Registriert seit: 21. Aug 2006
2 Beiträge
|
Re: Windows Registry Rekursiv auslesen
21. Aug 2006, 13:29
Hallo,
so könnte es gehen:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
Registry : TRegistry;
KeyList : TStringList;
procedure ReadRegistry(key : string; level : integer);
var
sl : TStringList;
i : integer;
begin
sl := TStringList.create;
try
with Registry do begin
OpenKey(key, False);
GetKeynames(sl);
CloseKey;
end;
for i := 0 to sl.count - 1 do begin
KeyList.add(Dupestring('-', level) + '+' + sl[i]);
ReadRegistry(key + '\' + sl[i], level + 1);
end;
finally
sl.free;
end;
end;
begin
KeyList := TStringList.create;
Registry := TRegistry.Create;
with Registry do
try
RootKey := HKEY_LOCAL_MACHINE;
ReadRegistry('', 0);
finally
Registry.Free;
KeyList.free;
end;
end;
viel Erfolg
Jörg
|
|
Zitat
|