//ini也可以实现多级菜单操作,需要递归搜索ini文件

TiniOptiType=(IniOpDelete,IniOpWrite,IniOpRead) //声明了一个删除、写、读的枚举类型
function iniOptiOnce(Fpath:string;IniOptiType:TiniOptiType;sec:string;key:string;value:string='';strDef:string=''):string; var configIni:TIniFile; begin Result:=''; if not FileExists(Fpath) then Exit; configIni:=TIniFile.Create(Fpath); try case IniOptiType of IniOpDelete: begin configIni.DeleteKey(sec,key); end; IniOpWrite: begin configIni.WriteString(sec,key,value); end; IniOpRead: begin Result:=configIni.ReadString(sec,key,strDef); end; end; finally configIni.Free; end; end;

 

 

相关文章:

  • 2021-06-17
  • 2021-07-06
  • 2021-06-15
  • 2021-06-01
  • 2022-01-01
猜你喜欢
  • 2021-09-13
  • 2021-05-25
  • 2022-01-07
  • 2021-08-26
  • 2021-06-01
  • 2021-07-06
相关资源
相似解决方案