asp源码打包成xml的工具(3)
Next
Set objFolder =Nothing
Set objSubFolders =Nothing
Set fso =Nothing
EndSub
'创建一个空的XML文件,为写入文件作准备
Sub CreateXml(FilePath)
'程序开始执行时间
startime = Timer()
Dim XmlDoc, Root
Set XmlDoc = Server.CreateObject("Microsoft.XMLDOM")
XmlDoc.async =False
Set Root = XmlDoc.createProcessingInstruction("xml","version='1.0' encoding='UTF-8'")
XmlDoc.appendChild(Root)
XmlDoc.appendChild(XmlDoc.CreateElement("root"))
XmlDoc.Save(Server.MapPath(FilePath))
Set Root =Nothing
Set XmlDoc =Nothing
LoadData(ZipPathDir)
'程序结束时间
endtime = Timer()
response.Write("页面执行时间:"& FormatNumber((endtime - startime),3)&"秒")
EndSub
%>
</body>
</html>
下边这个存为Install.asp,安装XML打包文件时运行
复制代码 代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%OptionExplicit%>
<%OnErrorResumeNext%>
<% Response.Charset="UTF-8"%>
<% Server.ScriptTimeout=99999999%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metahttp-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 =4Then
If objXmlFile.parseError.errorCode =0Then
Set objNodeList = objXmlFile.documentElement.selectNodes("//folder/path")
Set objFSO = CreateObject("Scripting.FileSystemObject")
j = objNodeList.Length -1
内容版权声明:除非注明,否则皆为本站原创文章。