ASP解压缩(在线解压缩类)
网络编程 2021-07-05 10:58www.168986.cn编程入门
代码如下:
<%
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\ 1. c:\windows\system32\cmd.exe
'\\ 拷贝把本文件所在的路径
'\\
'\\ 2. 把 c:\program\winrar\rar.exe
'\\ 拷贝把本文件所在的路径 并改名为WinRAR.exe
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\ pressPath(byVal s)
'\\ 压缩文件的路径 | 字符串变体
'\\
'\\ depressPath(byVal s)
'\\ 解压缩文件的文件夹 | 字符串变体
'\\
'\\ press
'\\ 在线压缩
'\\
'\\ depress
'\\ 在线解压缩
'\\
'\\ POWER BY never-online
'\\
'\\ EMAIL : Bluedestiny[at]126.
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
OPTION EXPLICIT
class COMPRESS_DECOMPRESS_FILES
private version, copyright
private oWshShell, oFso
private sCompressPath, sDepressPath
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 callSu(byVal s)
writeLn "<p><b>SUCCESS:</b></p>" + s
end Sub
public sub press
validateFile(sCompressPath)
oWshShell.run("WinRAR A " + sCompressPath + " " + sDepressPath & "")
if Err.number>0 then callErr("press lost!")
callSu("press <b>" + sDepressPath + "</b> to <b>" + sCompressPath + ".rar</b> suessfully!")
end Sub
public sub depress
validateFile(sCompressPath)
createFolder(sDepressPath)
oWshShell.run("WinRAR X " + sCompressPath + " " + sDepressPath & "")
if Err.number>0 then callErr("depress lost!")
callSu("depress <b>" + sCompressPath + ".rar</b> to <b>" + sDepressPath + "</b> suessfully!")
end sub
public property Let pressPath(byVal s)
sCompressPath=physicalPath(s)
end property
public property Let depressPath(byVal s)
sDepressPath=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>
<%
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\ 设有压缩文件 press.rar
'\\ 需压缩文件 depressFolder 文件夹
'\\
'\\ 将 press.rar 解压缩至 1 文件夹
'\\ 将 depressFolder 文件夹 压缩至 2.rar
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
dim oExample
set oExample=new COMPRESS_DECOMPRESS_FILES
oExample.pressPath="depressFolder"
oExample.depresspath="1"
oExample.press
oExample.pressPath="press"
oExample.depresspath="2"
oExample.depress
set oExample=nothing
%>
</BODY>
</HTML>
上一篇:使用ASP删除指定IIS站点
下一篇:ASP是否可以定时触发事件
编程语言
- 如何快速学会编程 如何快速学会ug编程
- 免费学编程的app 推荐12个免费学编程的好网站
- 电脑怎么编程:电脑怎么编程网咯游戏菜单图标
- 如何写代码新手教学 如何写代码新手教学手机
- 基础编程入门教程视频 基础编程入门教程视频华
- 编程演示:编程演示浦丰投针过程
- 乐高编程加盟 乐高积木编程加盟
- 跟我学plc编程 plc编程自学入门视频教程
- ug编程成航林总 ug编程实战视频
- 孩子学编程的好处和坏处
- 初学者学编程该从哪里开始 新手学编程从哪里入
- 慢走丝编程 慢走丝编程难学吗
- 国内十强少儿编程机构 中国少儿编程机构十强有
- 成人计算机速成培训班 成人计算机速成培训班办
- 孩子学编程网上课程哪家好 儿童学编程比较好的
- 代码编程教学入门软件 代码编程教程