uses IniFiles;
procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
myinifile : Tinifile;
Filename : string;
begin
Filename := ExtractFilePath(Paramstr(0)) + 'program.ini';
myinifile := Tinifile.Create(filename);
try
for i := 0 to listbox1.Items.Count - 1do
begin
myinifile.writestring('items', listbox1.Items.Strings, '0');
end;
finally
myinifile.Free;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
myinifile : Tinifile;
Filename : string;
begin
Filename := ExtractFilePath(Paramstr(0)) + 'program.ini';
myinifile := Tinifile.Create(filename);
try
Listbox1.Items.Clear;
SHOWMESSAGE('AAA');
myinifile.readsection('items', listbox1.Items);
finally
myinifile.Free;
end;
end;