asp实现在线压缩和解压缩
来源:互联网 发布:医生用药软件 编辑:程序博客网 时间:2024/06/01 17:20
附带实例
<%
'/////////////////////////////
'/
'/ 1. c:windows/system32/cmd.exe
'/ 拷贝把本文件所在的路径
'/
'/ 2. 把 c:program/winrar/rar.exe
'/ 拷贝把本文件所在的路径 并改名为WinRAR.exe
'/
'/////////////////////////////
'/
'/ compressPath(byVal s)
'/ 压缩文件的路径 | 字符串变体
'/
'/ decompressPath(byVal s)
'/ 解压缩文件的文件夹 | 字符串变体
'/
'/ compress
'/ 在线压缩
'/
'/ decompress
'/ 在线解压缩
'/
'/ POWER BY MIRACLE (BLUEDESTINY)
'/
'/ 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> New Document </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>
<%
'/////////////////////////////
'/
'/ 设有压缩文件 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.rar"
oExample.decompresspath="2"
oExample.decompress
set oExample=nothing
%>
</BODY>
</HTML>
'/////////////////////////////
'/
'/ 1. c:windows/system32/cmd.exe
'/ 拷贝把本文件所在的路径
'/
'/ 2. 把 c:program/winrar/rar.exe
'/ 拷贝把本文件所在的路径 并改名为WinRAR.exe
'/
'/////////////////////////////
'/
'/ compressPath(byVal s)
'/ 压缩文件的路径 | 字符串变体
'/
'/ decompressPath(byVal s)
'/ 解压缩文件的文件夹 | 字符串变体
'/
'/ compress
'/ 在线压缩
'/
'/ decompress
'/ 在线解压缩
'/
'/ POWER BY MIRACLE (BLUEDESTINY)
'/
'/ 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> New Document </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>
<%
'/////////////////////////////
'/
'/ 设有压缩文件 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.rar"
oExample.decompresspath="2"
oExample.decompress
set oExample=nothing
%>
</BODY>
</HTML>
- asp实现在线压缩和解压缩
- asp.net在线压缩和解压缩的实现
- asp.net在线压缩和解压缩的实现
- 用ASP.NET实现文件的在线压缩和解压缩
- 用ASP.Net实现文件的在线压缩和解压缩
- asp.net在线压缩和解压缩的实现v
- 用ASP.Net实现文件的在线压缩和解压缩
- 用ASP.Net实现文件的在线压缩和解压缩
- 用ASP.Net实现文件的在线压缩和解压缩
- 用ASP.NET实现文件的在线压缩和解压缩
- asp.net在线压缩和解压缩的实现
- ASP.Net实现文件的在线压缩和解压缩
- 用ASP.NET实现文件的在线压缩和解压缩
- asp.net文件在线压缩和解压缩
- 在线实现WINRAR压缩和解压缩
- 用ASP.Net实现文件的在线压缩和解压缩[出处:CSDN]
- 在asp.net中实现在线文件的压缩和解压缩
- vs 2003 实现文件的在线压缩和解压缩
- treeview N层节点 设置
- Team Foundation Server 单服务器如何还原???
- js中showModalDialog传参
- 磁盘mbr的反编译
- 工作
- asp实现在线压缩和解压缩
- 海尔在美设厂竟为赚利差
- 如何将国际域名绑定ADSL动态IP地址
- 2007年3月初,不爽的10天
- CSDN Blog 早上是怎么了?
- struts Bean标签库
- asp.net中如何回车触发指定按钮的事件
- 在ReportingService中實現復雜判斷
- 转换为FLV