国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp源碼打包成xml的工具

2024-05-04 11:00:42
字體:
來源:轉載
供稿:網友
下邊這個存為Pack.asp,打包文件時運行
復制代碼 代碼如下:
<%@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 ZipPathDir, ZipPathFile 
Dim startime, endtime 
'在此更改要打包文件夾的路徑 
ZipPathDir ="F:/www.yongfa365.com"' 
ZipPathFile ="update.xml" 
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(ZipPathFile) 
    XmlDoc.async =False 

'寫入每個文件夾路徑 
Set Xfolder = XmlDoc.SelectSingleNode("http://root").AppendChild(XmlDoc.CreateElement("folder")) 
Set Xfpath = Xfolder.AppendChild(XmlDoc.CreateElement("path")) 
    Xfpath.text = Replace(DirPath, ZipPathDir,"") 
Set objFiles = objFolder.Files 
    ForEach objFile in objFiles 
        If LCase(DirPath & objFile.Name)<> LCase(Request.ServerVariables("PATH_TRANSLATED"))Then 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 花莲县| 镇平县| 边坝县| 扶风县| 深圳市| 越西县| 阜南县| 应城市| 宜良县| 璧山县| 高密市| 阿拉善盟| 新郑市| 拜城县| 吉木乃县| 札达县| 南京市| 静宁县| 休宁县| 荥经县| 乌兰浩特市| 壤塘县| 赤峰市| 哈尔滨市| 会同县| 岳阳县| 巴青县| 象州县| 新化县| 镇沅| 汝州市| 长宁区| 扎囊县| 房山区| 建水县| 岚皋县| 澳门| 宜宾市| 宣汉县| 化州市| 庄浪县|