回复 44# pyj521 #Include <File.au3>
$aFile = _FileListToArray(@ScriptDir, '*.xml',1)
If @Error Then Exit
For $i = 1 To $aFile[0]
_Re2File(@ScriptDir & '\' & $aFile[$i])
Sleep(1)
Next
Func _Re2File($File)
Local $FileNew = $File
Local $str = FileRead($File)
$str = StringReplace($str, '<item id="From"><![CDATA[DAJIAHAO (http://www.baidu.com/)]]></item>', _
'<item id="From"><![CDATA[NIHAO (http://www.360.com/)]]></item>')
$str = StringReplace($str, '<item id="copyright"><![CDATA[还好吗|www.baidu.com]]></item>', _
'<item id="copyright"><![CDATA[都很好|www.360.com]]></item>')
Local $hFO = FileOpen($FileNew, 2)
FileWrite($hFO, $str)
FileClose($hFO)
EndFunc ;==>_Re2File
|