uses Inifiles;
// List sections
procedure ListIniSections(const IniFile: string; Sections: TStrings);
begin
Sections.BeginUpdate;
try
with TIniFile.Create(IniFile) do
try
ReadSections(Sections);
finally
Free;
end;
finally
Sections.EndUpdate;
end;
end;
// list values of section
procedure ListIniSectionValues(const IniFile, Section: string; Values: TStrings);
begin
Values.BeginUpdate;
try
with TIniFile.Create(IniFile) do
try
ReadSection(Section, Values);
finally
Free;
end;
finally
Values.EndUpdate;
end;
end;
// list values and datas of section
procedure ListIniSectionValuesAndDatas(const IniFile, Section: string; ValuesAndDatas: TStrings);
begin
ValuesAndDatas.BeginUpdate;
try
with TIniFile.Create(IniFile) do
try
ReadSectionValues(Section, ValuesAndDatas);
finally
Free;
end;
finally
ValuesAndDatas.EndUpdate;
end;
end;