procedure TForm1.ReWriteINi(Const ASrcIniFile,ADstIniFile:Tfilename);
var
Src,Dst:Tinifile;
SList,KList:Tstringlist;
i,j:integer;
begin
Src:=Tinifile.Create(ASrcIniFile);
sList:=Tstringlist.Create;
src.ReadSections(Slist);
if slist.Count > 0 then
begin
Klist:=Tstringlist.Create;
dst:=Tinifile.Create(AdstInifile);
try
for i:=0 to slist.Count -1 do
begin
src.ReadSection(slist[i],Klist);
if Klist.Count > 0 then
for j:=0 to Klist.Count -1 do
dst.WriteString(slist[i],klist[j],src.ReadString(slist[i],klist[j],''));
end;
finally
dst.Free;
klist.Free;
end;
end;
src.Free;
slist.Free;
end;