Func iniRenameKeyword($iniPatch, $Section, $Keyword, $NewKeyword)
$var = IniReadSection($iniPatch, $Section)
For $i = 1 To $var[0][0]
If $var[$i][0] = $Keyword Then
$var[$i][0] = $NewKeyword
ExitLoop
EndIf
Next
IniDelete($iniPatch, $Section)
IniWriteSection($iniPatch, $Section, $var, 1)
EndFunc ;==>iniRenameKeyword
不知道是不是这个
先将改字段下的所有关键字和值都存到一个2维数组中,再通过For循环找到要修改的关键字并修改成新的关键字,然后再将数组写入到ini文件中
目前仅时主要步骤,具体细节还要完善
[ 本帖最后由 sxi3265 于 2009-1-30 00:25 编辑 ] |