<%
OnerrorResumEnext
Dimr
SETR = NewRar
R.addserver.mappath ("a.gif")
r.addserver.mappath ("a.txt")
r.addserver.mappath ("prueba")
R.addserver.mappath ("File.asp")
r.packname = server.mappath ("xxx.dat")
R. PACA
R.ROOTPATH = server.mappath ("xxx")
r.packname = server.mappath ("xxx.dat")
r.unpack
Response.Write (Err.Description)
SETR = nada
%>
<scriptLanguage = "vBscript" runat = "servidor">
'-----------------------------------------------------
'Descripción: clase de embalaje ASP
'Autor: Xiaohui ([email protected])
'Enlace: http: //asp2004.nethttp: //blog.csdn.net/iuhxqhttp: //bbs.asp2004.net
'Versión: 1.0beta
'Copyright: este trabajo es de uso gratuito, pero no elimine la información de los derechos de autor
'-----------------------------------------------------
Clase
Dimfiles, PackName, S, S1, S2, RootPath, FSO, F, BUF
Privatesubclass_initialize
Aleatorizar
Dimrannum
rannum = int (90000*rnd) +10000
PackName = año (ahora) y mes (ahora) y día (ahora) & Hour (ahora) y minuto (ahora) y segundo (ahora) & rannum & ". ASP2004"
rootpath = server.mappath ("./")
SetFiles = server.createObject ("scripting.dictionary")
Setfso = server.createObject ("scripting.filesystemObject")
Sets = server.createObject ("ADODB.Stream"): s.open:s.type=1
Sets1 = server.createObject ("adodb.stream"): s1.open:s1.type=1
Sets2 = server.createObject ("ADODB.Stream"): S2.open:s2.Type=2
Endsub
Privatesubclass_merminate
S.Close: Sets = nada
s1.close: sets1 = nada
s2.close: sets2 = nada
Setfso = nada
Endsub
Publicsubadd (OBJ)
Ifffso.fileExists (obj) entonces
Setf = fso.getfile (obj)
files.addobj, f.size
Elseifso.foldereRexists (obj) entonces
files.addobj, -1
Setf = fso.getfolder (obj)
Setfc = f.files
Foreachf1infc
Agregar (lcase (f1.path))
Próximo
Endif
Endsub
Colegia pública
Dimstratido
a = files.Keys
b = archivos.Items
fori = 0tofiles.Count-1
Ifb (i)> = 0then
S.LoadFromFile (a (i))
BUF = S.Read
Ifnotisnull (buf) thens1.write (buf)
Endif