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


        next
    end function
%>
</body>
</html>

解压asp文件
复制代码 代码如下:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% Option Explicit %>
<% On Error Resume Next %>
<% Response.Charset="UTF-8" %>
<% Server.ScriptTimeout=99999999 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文件解包程序</title>
</head>

<body>
<%
    Dim strLocalPath
    '得到当前文件夹的物理路径
    strLocalPath=Left(Request.ServerVariables("PATH_TRANSLATED"),InStrRev(Request.ServerVariables("PATH_TRANSLATED"),"\"))

    Dim objXmlFile
    Dim objNodeList
    Dim objFSO
    Dim objStream
    Dim i,j

    Set objXmlFile = Server.CreateObject("Microsoft.XMLDOM")
        objXmlFile.load(Server.MapPath("update.xml"))

        If objXmlFile.readyState=4 Then
            If objXmlFile.parseError.errorCode = 0 Then

                Set objNodeList = objXmlFile.documentElement.selectNodes("//folder/path")
                Set objFSO = CreateObject("Scripting.FileSystemObject")

                    j=objNodeList.length-1
                    For i=0 To j
                        If objFSO.FolderExists(strLocalPath & objNodeList(i).text)=False Then
                            objFSO.CreateFolder(strLocalPath & objNodeList(i).text)

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

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