1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| procedure TForm1.Button6Click(Sender: TObject);
Var F : TIniFile;
i:integer;
CountItems: Integer;
begin
SaveDialog1.InitialDir := 'C:\MyProjects';
if opendialog1.Execute then
begin
F := TIniFile.Create(OpenDialog1.FileName);
try
CountItems := F.ReadInteger('Liste1', 'CountItems', 0);
for i := 0 to CountItems - 1 do
ListBox1.Items.Add(F.ReadString('Liste1', Format('ligne%d', [i]), ''));
CountItems := F.ReadInteger('Liste2', 'CountItems', 0);
for i := 0 to CountItems - 1 do
ListBox2.Items.Add(F.ReadString('Liste2', Format('ligne%d', [i]), ''));
CountItems := F.ReadInteger('Liste3', 'CountItems', 0);
for i := 0 to CountItems - 1 do
ListBox3.Items.Add(F.ReadString('Liste3', Format('ligne%d', [i]), ''));
CountItems := F.ReadInteger('Liste4', 'CountItems', 0);
for i := 0 to CountItems - 1 do
ListBox4.Items.Add(F.ReadString('Liste4', Format('ligne%d', [i]), ''));
finally
F.Free;
end;
end;
end; |
Partager