1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Var FileIni : TIniFile;
Compteur : Integer;
Section : TStringList;
begin
FileIni:=TIniFile.Create('C:\Temp\Test.ini'); // Ouvre ou crée le fichier
try
Section:=TStringList.Create;
try
FileIni.ReadSections(Section);
For Compteur:=0 to Section.Count-1 do
begin
// Lecture des valeurs de la section Section[Compteur]
Memo1.Lines.Add(#13#10+'['+Section[Compteur]+']');
FileIni.ReadSectionValues(Section[Compteur],Memo1.Lines);
end;
finally
Section.Free;
end;
finally
FileIni.Free;
end;
end; |
Partager