本帖最后由 tryhi 于 2011-10-18 18:38 编辑
写个很菜的函数给你用
将iniread换成_IniRead_tryhi使用
$aaaa = _IniRead_tryhi('1.ini','FOUND1','item5','')
MsgBox(0,0,$aaaa)
Func _IniRead_tryhi($ininame,$ziduan,$guanjianzi,$morenzhi)
$text0 = FileRead($ininame)
$text = $text0&@CRLF&'[75h54$#?k4t8c6d25^><]'
$zd = StringRegExp($text,'(?m)(?<=\['&$ziduan&'\])[\s\S]+(?=\[.*\])',3)
If @error Then Return $morenzhi
$zdx = $zd[0]&@CRLF&'75#?k25^h54$>4t8c6d<='
$jieguo = StringRegExp($zdx,'(?<='&$guanjianzi&')[\s\S]*?(?=\v.+=)',3)
If @error Then Return $morenzhi
Return $jieguo[0]
EndFunc
|