本帖最后由 dtooboss 于 2010-5-25 14:30 编辑
回复 dtooboss
改不了。。。
woeiwoei 发表于 2010-5-25 14:18 $ini =_IniReadSection( '数据.ini','vs')
For $n = 1 To $ini[0][0] Step 1
IniWrite('新数据.ini','vs', StringReplace($ini[$n][0], StringLeft($ini[$n][0], 6), "000000" ),$ini[$n][1])
Next
Func _IniReadSection($iFile, $Section, $mode = 0); afan 斑竹的udf
Local $_Section, $s_Sec, $s_zl, $ii = 1, $i
Local $o_File = FileOpen($iFile, $mode)
Local $s_File = String(FileRead($o_File))
FileClose($o_File)
$_Section = StringRegExpReplace('[' & $Section & ']', '(\.|\||\*|\?|\+|\(|\)|\{|\}|\[|\]|\^|\$|\\)', '\\$1')
$s_Sec = StringRegExp($s_File & @CRLF & '[', '(?s)(?i)' & $_Section & '(.+?)\r\n\[', 3)
If @error Then Return SetError(1, 0, 0)
$s_zl = StringRegExp($s_Sec[0], '\n\s*([^=;\s][^=\r\n]*)\=(.*)', 3)
If @error Then Return SetError(2, 0, 0)
Local $2_array[UBound($s_zl) / 2 + 1][2] = [[UBound($s_zl) / 2]]
For $i = 0 To UBound($s_zl) - 1 Step 2
$2_array[$ii][0] = $s_zl[$i]
$2_array[$ii][1] = $s_zl[$i + 1]
$ii += 1
Next
Return $2_array
EndFunc ;==>_IniReadSection
|