複製代碼代碼如下:
<%
'///////////////////////////////////////////////////////////
'//
'//1.c:/windows/system32/cmd.exe
'//拷貝把本文件所在的路徑
'//
'//2.把c:/program/winrar/rar.exe
'//拷貝把本文件所在的路徑並改名為WinRAR.exe
'//
'///////////////////////////////////////////////////////////
'//
'//compressPath(byVals)
'//壓縮文件的路徑|字符串變體
'//
'//decompressPath(byVals)
'//解壓縮文件的文件夾|字符串變體
'//
'//compress
'//在線壓縮
'//
'//decompress
'//在線解壓縮
'//
'//POWERBYnever-online
'//
'//EMAIL:Bluedestiny[at]126.com
'//
'///////////////////////////////////////////////////////////
OPTIONEXPLICIT
classCOMPRESS_DECOMPRESS_FILES
privateversion,copyright
privateoWshShell,oFso
privatesCompressPath,sDecompressPath
privatesubclass_initialize
version="COMPRESS_DECOMPRESS_FILESBUILDER20051015"
copyright="POWERBYMIRACLE(BLUEDESTINY)"
SetoFso=server.CreateObject("scripting.FileSystemObject")
SetoWshShell=server.CreateObject("Wscript.Shell")
writeLn(version+"<br>"+copyright)
endSub
privatesubclass_terminate
ifisobject(oWshShell)thensetoWshShell=nothing
ifisobject(oFso)thensetoFso=nothing
endSub
privatefunctionphysicalPath(byVals)
physicalPath=server.mappath(s)
endFunction
privatesubvalidateFile(byVals)
ifoFso.FileExists(s)thenexitsub
ifoFso.FolderExists(s)thenexitsub
callErr"file(folder)notexists!"
endSub
privatesubcreateFolder(byVals)
ifoFso.FolderExists(s)thenexitSub
oFso.createFolder(s)
endSub
privatesubwriteLn(byVals)
response.write"<p>"+s+"</p>"+vbCrlf
endSub
privatesubcallErr(byVals)
writeLn"<p><b>ERROR:</b></p>"+s
response.End
endsub
privatesubcallSucc(byVals)
writeLn"<p><b>SUCCESS:</b></p>"+s
endSub
publicsubcompress
validateFile(sCompressPath)
oWshShell.run("WinRARA"+sCompressPath+""+sDecompressPath&"")