Const forreading=1,forwriting=2,forappending=8
Const trisateusedefault=-2,tristatetrue=-1,tristatefalse=0
Dim fso,f,ts,tr
Set fso=createobject("scripting.filesystemobject")
Set f=fso.opentextfile("e:\channel_info.txt",forwriting,true)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set doc = XMLUtil.CreateXML()
doc.LoadFile "C:\Program Files\BitMov XM\ChannelList\Channel.xml"
Set root = doc.GetRootElement()
Set QQp= root.ChildElements()
Set QQp1 =QQp.Item(1)
Set dianbo=QQp1.ChildElements()
Set dianbo1 =dianbo.Item(1)
Set dianbo2=dianbo1.ChildElements()
For k=1 to dianbo2.count()
Set movies=dianbo2.item(k)'设置为电影栏或电视剧栏
Set child_movies=movies.childelements()
count_movies=child_movies.count() '求有多少节目类别
Set attribs_total=movies.attributes()
Set attr_total=attribs_total.item(1)
namestr_total=attr_total.name()
valstr_total=attr_total.value()
For i=1 to count_movies '外层循环节目的类别数
Set ch_movies=child_movies.item(i)
Set ch1_movies=ch_movies.childelements()
Set attribs=ch_movies.attributes()
Set attr=attribs.item(1)
namestr=attr.name()
valstr=attr.value() '求出每个节目类别的名字
count1_movies=ch1_movies.count() '求出电影栏下每个类别有多少节目
For j=1 to count1_movies '内层循环每个类别下的节目
Set ch1_movies=ch_movies.childelements() ''''以下是求出某个类别下的第“”“j”“”个影片的名字
Set ch11_movies=ch1_movies.item(j)
Set attribs_cell=ch11_movies.attributes()
Set attr_cell=attribs_cell.item(2)
namestr_cell=attr_cell.name()
valstr_cell=attr_cell.value()
'msgbox valstr_cell
nam=valstr_total&"("&count_movies&")"&";"&valstr&"("&count1_movies&")"&";"&valstr_cell
'wait (1)
f.writeline nam '向文件里写入节目名字
Next
Next
Next
f.close作者: Randall 时间: 2008-6-14 16:11