StrVal=ReadIniFile(FilePath,Secstr,"H","0"); end-- function Update
functionGetStringValue() ifnot StrVal then StrVal="can not get anystring!"end ; return StrVal;
end-- function GetStringValue
functionReadIniFile(filename,section,Key,default) local gotsec=false; local i,j=nil,nil; local Keyvalue=nil;
ifnot filename or filename==""then return"missing "filename"";
elseifnot section or section==""then return"missing "secName""; elseifnot Key or Key==""then return"missing "keyName""; end ;
section=string.lower(section); Key=string.lower(Key); for tmp inio.lines(filename,r) do tmp=string.lower(tmp); ifnot gotsec then i,j=string.find(tmp,section.."]"); if i then gotsec=trueend; else i,j,Keyvalue=string.find(tmp,Key.."%s*=%s*(.*)%s*"); --print(Keyvalue); if i thenbreakend; end; end; ----io.close(FileN); ifnot Keyvalue then Keyvalue=default end; return Keyvalue; end