strC = "<?xml version=""1.0"" encoding=""utf-8""?> " & vbcrlf
strC = strC&"<main delay_time=""3"" menu_visible=""yes"" menu_axis=""x"" menu_x=""10"" menu_y=""290"" bannerBTN=""no"" menu_spacer=""5"" bgColor=""0x2F2F2F"" preloaderColor=""0xffffff"">" & vbcrlf
set rs = server.CreateObject("adodb.recordset")
rs.open"select * from xw where xwlb_id=31 order by px_id desc,tjsj desc",cn,1,3
for j=1 to rs.recordcount
strC = strC&"<slideshow><picture_path>"&mid(rs("tpdz"),4,len(rs("tpdz")))&"</picture_path><web_address></web_address><id>"&j&"</id></slideshow>"& vbcrlf
rs.movenext
next
rs.close
set rs=nothing
strC = strC&" </main>" & vbcrlf
call saveXml(strC,"../admin/xml/imglink.xml")
Function saveXml(Text,FileName)
dim xmldoc,path
set xmldoc= server.CreateObject("MSXML.DOMDocument")
path = Server.MapPath(FileName)
xmldoc.LoadXML(Text)
xmldoc.save(path)
set xmldoc= nothing
End Function
以上測試通過
歡迎大家使用