-
ASPZIP是一款用于ASP打包ZIP文件的组件
资源介绍
Function AspZip(z_upFile,z_doFile)
zip_upFile=Server.MapPath(z_upFile)
zip_infile=Server.MapPath("下载说明.txt")
zip_doFile=Server.MapPath(z_doFile)
zip_uptime=now()
randomize
zip_ranNum=int(90000*rnd)+10000
zip_ininame=year(zip_uptime)&"-"&month(zip_uptime)&"-"&day(zip_uptime)&"-"&hour(zip_uptime)&"-"&minute(zip_uptime)&"-"&second(zip_uptime)&"-"&zip_ranNum&".ini"
zip_inifile=Server.MapPath("/test/")
Set zip_fs = CreateObject("Scripting.FileSystemObject")
File=zip_inifile
Set zip_txt=zip_fs.OpenTextFile(File,8,True) '打开成可以在结尾写入数据的文件
zip_txt.WriteLine("[Files]")
zip_txt.WriteLine("count = 2")
zip_txt.WriteLine("")
zip_txt.WriteLine("[0]")
zip_txt.WriteLine("path = "&zip_upFile)
zip_txt.WriteLine("")
zip_txt.WriteLine("[1]")
zip_txt.WriteLine("path = "&zip_infile)
zip_txt.Close
set zip_fs = nothing
'----------------------------------
dim zip_xazip
dim zip_bRet
dim zip_strError
set zip_xazip = Server.CreateObject("XingerAspZip.Control")
if IsObject(zip_xazip) then
zip_bRet = zip_xazip.MakeZip( _
zip_inifile, _
zip_doFile, _
true, _
zip_strError )
if CBool(zip_bRet)=false then
response.write "Error:" & zip_strError&"
" end if else response.write "组件未注册
" end if set zip_xazip = nothing '---------------------------------- Set zip_fso = CreateObject("Scripting.FileSystemObject") IF zip_fso.FileExists(zip_inifile) Then zip_fso.DeleteFile(zip_inifile) End IF Set zip_fso = Nothing End Function
" end if else response.write "组件未注册
" end if set zip_xazip = nothing '---------------------------------- Set zip_fso = CreateObject("Scripting.FileSystemObject") IF zip_fso.FileExists(zip_inifile) Then zip_fso.DeleteFile(zip_inifile) End IF Set zip_fso = Nothing End Function