国产探花免费观看_亚洲丰满少妇自慰呻吟_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 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阳泉市| 双江| 宜昌市| 靖江市| 铜陵市| 蛟河市| 侯马市| 牡丹江市| 泽普县| 申扎县| 商洛市| 阿克苏市| 富阳市| 钟山县| 晋中市| 卓尼县| 那坡县| 衡山县| 乾安县| 清涧县| 繁峙县| 宾阳县| 镇赉县| 山西省| 壶关县| 阜南县| 连云港市| 平湖市| 平利县| 宜良县| 普宁市| 云阳县| 灌云县| 三河市| 噶尔县| 依安县| 元氏县| 和林格尔县| 恩施市| 花垣县| 左云县|