|
本帖最后由 ashfinal 于 2009-10-21 23:01 编辑
关于XML函数的资料似乎不多,UDF _XMLDomWrapper.au3也没有什么例子。自己硬着头皮看了两天,写出来的东西还是一运行就崩溃。前几天有事放下一段时间,现在一看代码就头大。厚着脸皮上来问问各位高手...
思路是这样的:listbox含有分组信息,listview(共5个)对应分组另有数据。想把数据读取到XML文件。
看起来就像这样:
以下是部分代码(整体代码几百行,贴不下),大家帮忙看看有什么问题:
_XMLFileOpen("XPlode.xml")
_XMLCreateChildNode("XPlode4", "items")
$listcount = _GUICtrlListBox_GetCount($List1)
For $i = 1 To $listcount
$title = _GUICtrlListBox_GetText($List1, $i - 1)
_XMLCreateChildWAttr("XPlode4/items", "item", "display", $title)
Select
Case $i = 1
$viewcount = _GUICtrlListView_GetItemCount($ListView2)
For $j = 1 To $viewcount
$split = StringSplit(_GUICtrlListView_GetItemTextString($ListView2, $j - 1), "|")
$subtitle = StringMid($split[1], StringInStr($split[1], "KB"), 8)
_XMLCreateChildWAttr("XPlode4/items/item[1]", "execute", "display", "正在安装 " & $subtitle & " 请稍候...")
_XMLCreateChildNode("XPlode4/items/item[1]/execute[" & $j & "]", "program", "#XPLODE#\soft\" & $split[1])
_XMLCreateChildNode("XPlode4/items/item[1]/execute[" & $j & "]", "arguments", $split[2])
Next
Case $i = 2
$viewcount = _GUICtrlListView_GetItemCount($ListView3)
For $k = 1 To $viewcount
$split = StringSplit(_GUICtrlListView_GetItemTextString($ListView3, $k - 1), "|")
$subtitle = StringMid($split[1], StringInStr($split[1], "KB"), 8)
_XMLCreateChildWAttr("XPlode4/items/item[2]", "execute", "display", "正在安装 " & $subtitle & " 请稍候...")
_XMLCreateChildNode("XPlode4/items/item[2]/execute[" & $k & "]", "program", "#XPLODE#\soft\" & $split[1])
_XMLCreateChildNode("XPlode4/items/item[2]/execute[" & $k & "]", "arguments", $split[2])
Next
Case $i = 3
$viewcount = _GUICtrlListView_GetItemCount($ListView4)
For $l = 1 To $viewcount
$split = StringSplit(_GUICtrlListView_GetItemTextString($ListView4, $l - 1), "|")
$subtitle = StringMid($split[1], StringInStr($split[1], "KB"), 8)
_XMLCreateChildWAttr("XPlode4/items/item[3]", "execute", "display", "正在安装 " & $subtitle & " 请稍候...")
_XMLCreateChildNode("XPlode4/items/item[3]/execute[" & $l & "]", "program", "#XPLODE#\soft\" & $split[1])
_XMLCreateChildNode("XPlode4/items/item[3]/execute[" & $l & "]", "arguments", $split[2])
Next
Case $i = 4
$viewcount = _GUICtrlListView_GetItemCount($ListView5)
For $m = 1 To $viewcount
$split = StringSplit(_GUICtrlListView_GetItemTextString($ListView5, $m - 1), "|")
$subtitle = StringMid($split[1], StringInStr($split[1], "KB"), 8)
_XMLCreateChildWAttr("XPlode4/items/item[4]", "execute", "display", "正在安装 " & $subtitle & " 请稍候...")
_XMLCreateChildNode("XPlode4/items/item[4]/execute[" & $m & "]", "program", "#XPLODE#\soft\" & $split[1])
_XMLCreateChildNode("XPlode4/items/item[4]/execute[" & $m & "]", "arguments", $split[2])
Next
Case $i = 5
$viewcount = _GUICtrlListView_GetItemCount($ListView6)
For $n= 1 To $viewcount
$split = StringSplit(_GUICtrlListView_GetItemTextString($ListView6, $n - 1), "|")
$subtitle = StringMid($split[1], StringInStr($split[1], "KB"), 8)
_XMLCreateChildWAttr("XPlode4/items/item[5]", "execute", "display", "正在安装 " & $subtitle & " 请稍候...")
_XMLCreateChildNode("XPlode4/items/item[5]/execute[" & $n & "]", "program", "#XPLODE#\soft\" & $split[1])
_XMLCreateChildNode("XPlode4/items/item[5]/execute[" & $n & "]", "arguments", $split[2])
Next
EndSelect
Next |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|