举报
$open = FileOpen("如何修改.xml") $read = FileRead($open) FileClose($open) Local $Test = StringRegExpReplace($read, '(?<=homepagetype=")[^"]+', '5') $open = FileOpen("如何修改.xml", 2) FileWrite($open, $Test) FileClose($open)
#include <_XMLDomWrapper.au3> Local $oXMLDoc = _XMLFileOpen(@ScriptDir & "\1.xml") GetAttrib("value") _XMLSetAttrib("main/Item", "homepagetype", "5");设置新的属性值 GetAttrib("new value") Func GetAttrib($str) $attValue = _XMLGetAttrib("/main/Item", "homepagetype") MsgBox(0, "homepagetype", $str & "=" & $attValue) EndFunc ;==>GetAttrib
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度
GMT+8, 2026-1-4 17:35 , Processed in 0.263002 second(s), 23 queries .
Powered by Discuz! X3.5 Licensed
© 2001-2025 Discuz! Team.