2025-03-24 升级说明
----------------------------------------
修订:TMemIniFile erasesection方法无法删除掉section本身。
说明:修复了一个Bug:该Bug会导致删除指定Section后,被删除的Section名依然可以被读取到。
本地INI文件内容如下:
[Test]
string=TinySoft
TestForWrite=0
[ReadStream]
array=0a021f35
string=4265376941725678666a3871
TSL代码如下:
inipath := "D:\\test\\Case_LocalFile\\test.ini";
obj := new TMemIniFile();
setobj := new tstringlist();
setobj.LoadFromFile("",inipath); //加载INI文件内容
obj.SetStrings(setobj);
obj.EraseSection("ReadStream"); //删除指定Section
rs := new TStringList();
obj.ReadSections(rs); //读取当前INI所有Section
echo "content:"$rs.CommaText,"\r\n";
getobj := new TStringList();
obj.GetStrings(getobj); //读取当前INI所有内容
echo "IniFile content:"$getobj.CommaText,"\r\n";
return;
升级前:
升级后:
---------------------------------------
修订:TMemIniFile ValueExists和SectionExists在大小写敏感时查询到大小写不一致的内容。
说明:修复了一个Bug:该Bug会导致大小写敏感时,ValueExists和SectionExists会得到错误的结果。
本地INI文件内容同上。
TSL代码如下:
inipath := "D:\\test\\Case_LocalFile\\test.ini";
obj := new TMemIniFile();
obj.CaseSensitive := 1; //区分大小写
sLobj := new tstringlist();
sLobj.LoadFromFile("",inipath);
obj.SetStrings(sLobj);
echo obj.SectionExists("test"),"\r\n"; //指定节点是否存在
echo obj.ValueExists("Test","testforwrite"),"\r\n"; //指定键是否存在
return;
升级前:
升级后: