忠网广告 系统 用到的几个函数

2019-01-14 04:34:24王旭

          '根据得到的数据循环个节点名、值建立XML片段 
       XMLnode=brstr&"<"&Indexsite&">"

                
          textss=split(texts&"/$/","/$/") 
          texti=0

          Rootsitesns=split(Rootsitesn&"|","|")  
          For Rootsitesni=0 to ubound(Rootsitesns)-1

          XMLnode=XMLnode&brstr&"<"&Rootsitesns(Rootsitesni)&">"&textss(texti)&"</"&Rootsitesns(Rootsitesni)&">"
          texti=texti+1
          Next

       XMLnode=XMLnode&brstr&"</"&Indexsite&">"&brstr        


      Dim objXML2,rootNewNode
      set objXML2=Server.CreateObject("Microsoft.XMLDOM")    '建立一个新XML对像

      objXML2.loadXML(XMLnode)     '把XML版片段读入内存中 

      set rootNewNode=objXML2.documentElement    '获得objXML2的根节点 

      objRootsite.appendChild(rootNewNode)    '把XML片段插入 

  objXML.save(strSourceFile)

  Set objXML =nothing 

'' 释放 fso 
Set fso = nothing
end if
end if

end sub


'//********************************************************************
'  PubcSize(tSize) KB、MB、GB  单位转换函数
'********************************************************************//

function PubcSize(tSize)

    if tSize>=1073741824 then
        PubcSize=Round(int((tSize/1073741824)*1000)/1000,2) & " GB"
    elseif tSize>=1048576 then
        PubcSize=Round(int((tSize/1048576)*1000)/1000,2) & " MB"
    elseif tSize>=1024 then
        PubcSize=Round(int((tSize/1024)*1000)/1000,2) & " KB"
    else
        PubcSize=Round(tSize,2) & "B"
    end if