ASP解壓縮(在線解壓縮類)
更新時(shí)間:2007年01月09日 00:00:00 作者:
復(fù)制代碼 代碼如下:
<%
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\ 1. c:\windows\system32\cmd.exe
'\\ 拷貝把本文件所在的路徑
'\\
'\\ 2. 把 c:\program\winrar\rar.exe
'\\ 拷貝把本文件所在的路徑 并改名為WinRAR.exe
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\ compressPath(byVal s)
'\\ 壓縮文件的路徑 | 字符串變體
'\\
'\\ decompressPath(byVal s)
'\\ 解壓縮文件的文件夾 | 字符串變體
'\\
'\\ compress
'\\ 在線壓縮
'\\
'\\ decompress
'\\ 在線解壓縮
'\\
'\\ POWER BY never-online
'\\
'\\ EMAIL : Bluedestiny[at]126.com
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
OPTION EXPLICIT
class COMPRESS_DECOMPRESS_FILES
private version, copyright
private oWshShell, oFso
private sCompressPath, sDecompressPath
private sub class_initialize
version="COMPRESS_DECOMPRESS_FILES BUILDER 20051015"
copyright="POWER BY MIRACLE (BLUEDESTINY)"
Set oFso=server.CreateObject("scripting.FileSystemObject")
Set oWshShell=server.CreateObject("Wscript.Shell")
writeLn(version+"<br>"+copyright)
end Sub
private sub class_terminate
if isobject(oWshShell) then set oWshShell=nothing
if isobject(oFso) then set oFso=nothing
end Sub
private function physicalPath(byVal s)
physicalPath=server.mappath(s)
end Function
private sub validateFile(byVal s)
if oFso.FileExists(s) then exit sub
if oFso.FolderExists(s) then exit sub
callErr "file(folder) not exists!"
end Sub
private sub createFolder(byVal s)
if oFso.FolderExists(s) then exit Sub
oFso.createFolder(s)
end Sub
private sub writeLn(byVal s)
response.write "<p>" + s + "</p>" + vbCrlf
end Sub
private sub callErr(byVal s)
writeLn "<p><b>ERROR:</b></p>" + s
response.End
end sub
private sub callSucc(byVal s)
writeLn "<p><b>SUCCESS:</b></p>" + s
end Sub
public sub compress
validateFile(sCompressPath)
oWshShell.run("WinRAR A " + sCompressPath + " " + sDecompressPath & "")
if Err.number>0 then callErr("compress lost!")
callSucc("compress <b>" + sDecompressPath + "</b> to <b>" + sCompressPath + ".rar</b> successfully!")
end Sub
public sub decompress
validateFile(sCompressPath)
createFolder(sDecompressPath)
oWshShell.run("WinRAR X " + sCompressPath + " " + sDecompressPath & "")
if Err.number>0 then callErr("decompress lost!")
callSucc("decompress <b>" + sCompressPath + ".rar</b> to <b>" + sDecompressPath + "</b> successfully!")
end sub
public property Let compressPath(byVal s)
sCompressPath=physicalPath(s)
end property
public property Let decompressPath(byVal s)
sDecompressPath=physicalPath(s)
end property
End class
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> asp在線解壓縮 </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style>
* {
font-size:10.2pt;
font-family:tahoma;
}
</style>
</HEAD>
<BODY>
<%
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\ 設(shè)有壓縮文件 compress.rar
'\\ 需壓縮文件 decompressFolder 文件夾
'\\
'\\ 將 compress.rar 解壓縮至 1 文件夾
'\\ 將 decompressFolder 文件夾 壓縮至 2.rar
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
dim oExample
set oExample=new COMPRESS_DECOMPRESS_FILES
oExample.compressPath="decompressFolder"
oExample.decompresspath="1"
oExample.compress
oExample.compressPath="compress"
oExample.decompresspath="2"
oExample.decompress
set oExample=nothing
%>
</BODY>
</HTML>
相關(guān)文章
ASP獲取ACCESS數(shù)據(jù)庫表名及結(jié)構(gòu)的代碼
此方法可獲得ACCESS數(shù)據(jù)的表名及其結(jié)構(gòu),數(shù)據(jù)類型等... 程序過濾了幾個(gè)ACCESS數(shù)據(jù)庫的幾個(gè)隱藏表(可能是導(dǎo)致ACCESS數(shù)據(jù)庫刪除數(shù)據(jù)還會(huì)變大的原因)2008-08-08ASP刪除img標(biāo)簽的style屬性只保留src的正則函數(shù)
做手機(jī)網(wǎng)站的時(shí)候圖片要做自適應(yīng),由于手機(jī)網(wǎng)站跟PC網(wǎng)站共用1個(gè)數(shù)據(jù)庫,導(dǎo)致文章內(nèi)的圖片有部分帶有:style=""等屬性,導(dǎo)致手機(jī)端圖片width:100%失效,去掉mg標(biāo)簽style屬性只保留src即可解決問題2020-09-09實(shí)現(xiàn)純真IP txt轉(zhuǎn)mdb數(shù)據(jù)庫的方法
實(shí)現(xiàn)純真IP txt轉(zhuǎn)mdb數(shù)據(jù)庫的方法...2007-07-07通過MSXML2自動(dòng)獲取QQ個(gè)人頭像及在線情況(給初學(xué)者)
通過MSXML2自動(dòng)獲取QQ個(gè)人頭像及在線情況(給初學(xué)者)...2007-03-03asp實(shí)現(xiàn)過濾關(guān)鍵字的函數(shù)
asp實(shí)現(xiàn)過濾關(guān)鍵字的函數(shù)...2007-08-08