procedure TForm1.Button1Click(Sender: TObject);
var test:Tinifile;
tmplst:TStringList;
begin
test:=Tinifile.Create('c:\test.ini');
tmplst:=TStringList.Create ;
test.ReadSectionValues('yoursection',tmplst);
test.Free ;
tmplst.Free ;
end;
var test:Tinifile;
tmplst:TStringList;
begin
test:=Tinifile.Create('c:\test.ini');
tmplst:=TStringList.Create ;
test.ReadSectionValues('yoursection',tmplst);
test.Free ;
tmplst.Free ;
end;
但是还有点问题!
显示出来时他只有不同的变量才能读出
如:
t=hkljhlkjh
t2=khl;khj;lkj
才能读出
如都是
t=sdgfjsd
t=sdkjfl;sd
它就只能读出第一个
而且会把't='也读出来。
sl:= 'aa'#13'bb';
iniFile.WriteString('Section', 'VALUE', sl.CommaText);
sl.Free;...
sl.CommaText:= sl.ReadString('Section', 'Value', '');