|
下面是我写的,希望能帮上你,不过双引号没了.
Set doc = XMLUtil.CreateXML()
doc.CreateDocument "root"
Set root = doc.GetRootElement()
Dim rc : rc = micPass
For n= 1 to 9
root.AddChildElementByName "MonitorInstance",""
Set children = root.ChildElements()
str1= "id="&n
'msgbox str1
ip = "192.168.18.23-ping"
str2=" name="&cstr(ip)&n
'msgbox str2
num1="1"
num2="1100"
num3 = "10"
If rc = micPass Then str3 =cstr(str1)&"nodeID="&cstr(num1) &cstr(str2)&" monitorID="&cstr(num2 )&"interval="&cstr(num3) End If
'msgbox str3
If rc = micFail Then str3 = "第 "&N&" 次测试Fail" End If
root.AddChildElementByName "Result"&n,str3
doc.SaveFile "c:\report.xml".
Next |
|