用asp实现把文件打包成Xml文件包,带解包的ASP工(2)


        dim objSubFolders  '子文件夹集合
        dim objSubFolder   '子文件夹对象
        dim objFiles       '文件集合
        dim objFile        '文件对象
        dim objStream
        dim pathname,TextStream,pp,Xfolder,Xfpath,Xfile,Xpath,Xstream
        dim PathNameStr
        response.Write("=========="&DirPath&"==========<br>")
        set fso=server.CreateObject("scripting.filesystemobject")
        set objFolder=fso.GetFolder(DirPath)'创建文件夹对象

        Response.Write DirPath
        Response.flush

        Set XmlDoc = Server.CreateObject("Microsoft.XMLDOM")
        XmlDoc.load(Server.MapPath(ZipPathFile))
        XmlDoc.async=false

        '写入每个文件夹路径
        set Xfolder = XmlDoc.SelectSingleNode("//root").AppendChild(XmlDoc.CreateElement("folder"))
        Set Xfpath = Xfolder.AppendChild(XmlDoc.CreateElement("path"))
            Xfpath.text = replace(DirPath,ZipPathDir,"")
            set objFiles=objFolder.Files
                for each objFile in objFiles
                    if lcase(DirPath & objFile.name) <> lcase(Request.ServerVariables("PATH_TRANSLATED")) and lcase(DirPath & objFile.name) <> lcase(DirPath & ZipPathFile) then
                        if ext(objFile.name) then
                            Response.Write "---<br/>"
                            PathNameStr = DirPath & "" & objFile.name

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3152.html