728x90

참조
http://delphigeist.blogspot.com/2009/11/saveload-controls-from-inifile-using.html

uses
  inifiles;

procedure TForm1.FormCreate(Sender: TObject);
var
  IniFile  : TiniFile;
begin
  //
  IniFile  := TiniFile.Create(ChangeFileExt(Application.ExeName,'.ini'));
  try
    isDEBUG := IniFile.ReadBool('INFO', 'DEBUG', false);
  finally
    IniFile.Free;
  end;
end;

procedure TForm1.FormDestroy(Sender: TObject);
var
  IniFile  : TiniFile;
begin
  //
  IniFile  := TiniFile.Create(ChangeFileExt(Application.ExeName,'.ini'));
  try
    IniFile.WriteBool('INFO', 'DEBUG', isDEBUG);
  finally
    IniFile.Free;
  end;
end;

728x90

+ Recent posts