Asp学习站欢迎你!

将asp程序制作成为安装版:xml打包和解包

作者:Admin 时间:08-04-25 点击:

首先是打包(谈不上压缩,不过经常用ftp的情况下,经常这样打包会好很多的,ftp最怕的就是零碎文件太多,况且现在的网络情况...)

<%@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 ZipPathDir,ZipPathFile,ZipFileExt
Dim startime,endtime

'此为默认当前文件夹
ZipPathDir = Left(Request.ServerVariables("PATH_TRANSLATED"),InStrRev(Request.ServerVariables("PATH_TRANSLATED"),"\"))

'在此更改要打包文件夹的路径
'ZipPathDir="D:\MYWEB\WEBINFO"

'生成的xml文件
ZipPathFile = "update.xml"
'不进行打包的文件扩展名
ZipFileExt = "db;bak"
if right(ZipPathDir,1)<>"\" then ZipPathDir=ZipPathDir&"\"
'开始打包
CreateXml(ZipPathFile)
'遍历目录内的所有文件以及文件夹
sub LoadData(DirPath)
dim XmlDoc
dim fso 'fso对象
dim objFolder '文件夹对象
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(ZipPa

标签: xml】 【打印】 【关闭
最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 验证码: 验证码 查看所有评论