Gibt es eine Möglichkeit es ohne Textdatei zu machen?
z. B. in der Registry:
Delphi-Quellcode:
uses
Registry;
function RegIniPath: string;
begin
Result := 'Software\' + ExtractFileName(ChangeFileExt(ParamStr(0), ''));
end;
procedure TForm1.FormCreate(Sender: TObject);
var
RegIni: TRegIniFile;
begin
RegIni := TRegIniFile.Create(RegIniPath);
try
Edit1.Text := RegIni.ReadString('', 'Edit1', '');
finally
RegIni.Free;
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
var
RegIni: TRegIniFile;
begin
RegIni := TRegIniFile.Create(RegIniPath);
try
RegIni.WriteString('', 'Edit1', Edit1.Text);
finally
RegIni.Free;
end;
end;