手机
当前位置:查字典教程网 >编程开发 >ASP教程 >ASP解压缩(在线解压缩类)
ASP解压缩(在线解压缩类)
摘要:复制代码代码如下:

复制代码 代码如下:

<%

'\

'

'1.c:windowssystem32cmd.exe

'拷贝把本文件所在的路径

'

'2.把c:programwinrarrar.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&"")

ifErr.number>0thencallErr("compresslost!")

callSucc("compress<b>"+sDecompressPath+"</b>to<b>"+sCompressPath+".rar</b>successfully!")

endSub

publicsubdecompress

validateFile(sCompressPath)

createFolder(sDecompressPath)

oWshShell.run("WinRARX"+sCompressPath+""+sDecompressPath&"")

ifErr.number>0thencallErr("decompresslost!")

callSucc("decompress<b>"+sCompressPath+".rar</b>to<b>"+sDecompressPath+"</b>successfully!")

endsub

publicpropertyLetcompressPath(byVals)

sCompressPath=physicalPath(s)

endproperty

publicpropertyLetdecompressPath(byVals)

sDecompressPath=physicalPath(s)

endproperty

Endclass

%>

<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN">

<HTML>

<HEAD>

<TITLE>asp在线解压缩</TITLE>

<METANAME="Generator"CONTENT="EditPlus">

<METANAME="Author"CONTENT="">

<METANAME="Keywords"CONTENT="">

<METANAME="Description"CONTENT="">

<style>

*{

font-size:10.2pt;

font-family:tahoma;

}

</style>

</HEAD>

<BODY>

<%

'\

'

'设有压缩文件compress.rar

'需压缩文件decompressFolder文件夹

'

'将compress.rar解压缩至1文件夹

'将decompressFolder文件夹压缩至2.rar

'

'\

dimoExample

setoExample=newCOMPRESS_DECOMPRESS_FILES

oExample.compressPath="decompressFolder"

oExample.decompresspath="1"

oExample.compress

oExample.compressPath="compress"

oExample.decompresspath="2"

oExample.decompress

setoExample=nothing

%>

</BODY>

</HTML>

【ASP解压缩(在线解压缩类)】相关文章:

在线用表单建立文件夹

ASP与数据库,有用的代码(转贴,摘贴)

ASP怎么谈到应用到类的?

用ASP开"多线程"

asp 在线调查系统

ASP高级技巧精选集

ASP生成柱型体,折线图,饼图源代码

通过ASP自动解压RAR文件

asp调用二级分类代码

asp论坛在线人数统计研究

精品推荐
分类导航