(Gast)
n/a Beiträge
|
Re: Brauche hilfe bei Registry*
20. Mai 2009, 12:33
Hallo,
Zitat von Delphihilfe:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
Reg: TRegistry;
Val:TStringList;
I:Integer;
begin
Reg:=TRegistry.Create;
try
Val:=TStringList.Create;
try
Reg.RootKey:=HKEY_LOCAL_MACHINE; // Abschnitt in Registrierung
if not Reg.OpenKey(Edit1.Text,False) then
ShowMessage('Error opening key')
else
begin
Reg.GetValueNames(Val);
for I:=0 to Val.Count-1 do
begin
ShowMessage(Edit1.Text + Chr(13) +
'has an Entry Called '+Val.Strings[I]+Chr(13)+
'With a Value of '+Reg.ReadString(Val.Strings[I]));
end;
if MessageDlg('Ok to delete the key and lose all these values?'
,Mtinformation,[mbYes,mbNo],0)=mryes then
Reg.DeleteKey(Edit1.Text);
end;
finally
Val.Free;
end;
finally
Reg.Free;
end;
end;
|
|
Zitat
|