asp在线压缩和解压缩文件(文件夹)
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\
1. c:\windows\system32\cmd.exe
'\\ 拷贝把本文件所在的路径
'\\
'\\ 2. 把
c:\program\winrar\rar.exe
'\\ 拷贝把本文件所在的路径
并改名为WinRAR.exe
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\
compressPath(byVal s)
'\\ 压缩文件的路径 | 字符串变体
'\\
'\\ decompressPath(byVal
s)
'\\ 解压缩文件的文件夹 | 字符串变体
'\\
'\\ compress
'\\ 在线压缩 |
sub
'\\
'\\ decompress
'\\ 在线解压缩 | sub
'\\
'\\ POWER BY MIRACLE
(BLUEDESTINY)
'\\
'\\ EMAIL :
Bluedestiny[at]126.com
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
private oWshShell, oFso
private
sCompressPath, sDecompressPath
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
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
s)
sCompressPath=physicalPath(s)
end property
public property Let
decompressPath(byVal s)
sDecompressPath=physicalPath(s)
end property
%>
<!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>
<%
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\
设有压缩文件 compress.rar
'\\ 需压缩文件 decompressFolder 文件夹
'\\
'\\ 将
compress.rar 解压缩至 1 文件夹
'\\ 将 decompressFolder 文件夹 压缩至
2.rar
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
COMPRESS_DECOMPRESS_FILES
oExample.compressPath="decompressFolder"
oExample.decompresspath="1"
oExample.compress
oExample.decompresspath="2"
oExample.decompress
oExample=nothing
%>
</BODY>
</HTML>
asp在线压缩和解压缩文件(文件夹)的更多相关文章
- [Java 基础] 使用java.util.zip包压缩和解压缩文件
reference : http://www.open-open.com/lib/view/open1381641653833.html Java API中的import java.util.zip ...
- IOS开发之网络编程--文件压缩和解压缩
前言: QQ表情包就用到了解压缩,从网络下载的那么多表情文件格式并不是一个一个图片文件,而是多个图片压缩而成的表情压缩包.下面介绍的是iOS开发中会用到的压缩和解压缩的第三方框架的使用. 注意: 这个 ...
- iOS中使用ZipArchive压缩和解压缩文件-备
为什么我需要解压缩文件 有许多原因能解释为什么我要在工程中使用压缩和解压缩功能,下面是几个常见的原因: 苹果App Store的50M下载限制 苹 果公司出于流量的考虑,规定在非WIFI环境下,限制用 ...
- IO操作之使用zip包压缩和解压缩文件
转自:http://www.cdtarena.com/java.htmlJava API中的import java.util.zip.*;包下包含了Java对于压缩文件的所有相关操作. 我们可以使 ...
- Java用ZIP格式压缩和解压缩文件
转载:java jdk实例宝典 感觉讲的非常好就转载在这保存! java.util.zip包实现了Zip格式相关的类库,使用格式zip格式压缩和解压缩文件的时候,须要导入该包. 使用zipoutput ...
- 使用commons-compress操作zip文件(压缩和解压缩)
http://www.cnblogs.com/luxh/archive/2012/06/28/2568758.html Apache Commons Compress是一个压缩.解压缩文件的类库. 可 ...
- C# 利用ICSharpCode.SharpZipLib.dll 实现压缩和解压缩文件
我们 开发时经常会遇到需要压缩文件的需求,利用C#的开源组件ICSharpCode.SharpZipLib, 就可以很容易的实现压缩和解压缩功能. 压缩文件: /// <summary> ...
- ios开发网络学习五:MiMEType ,多线程下载文件思路,文件的压缩和解压缩
一:MiMEType:一般可以再百度上搜索到相应文件的MiMEType,或是利用c语言的api去获取文件的MiMEType : //对该文件发送一个异步请求,拿到文件的MIMEType - (void ...
- C# - WinFrm应用程序调用SharpZipLib实现文件的压缩和解压缩
前言 本篇主要记录:VS2019 WinFrm桌面应用程序调用SharpZipLib,实现文件的简单压缩和解压缩功能. SharpZipLib 开源地址戳这里. 准备工作 搭建WinFrm前台界面 添 ...
- Linux常用命令学习3---(文件的压缩和解压缩命令zip unzip tar、关机和重启命令shutdown reboot……)
1.压缩和解压缩命令 常用压缩格式:.zip..gz..bz2..tar.gz..tar.bz2..rar .zip格式压缩和解压缩命令 zip 压缩文件名 源文件:压缩文件 ...
随机推荐
- 史上最全的 Python 3 类型转换指南
int 支持转换为 int 类型的,仅有 float.str.bytes,其他类型均不支持. float -> int 会去掉小数点及后面的数值,仅保留整数部分. int(-12.94) # - ...
- IdentityServer4 中文文档 -3- (简介)已支持的规范
IdentityServer4 中文文档 -3- (简介)已支持的规范 原文:http://docs.identityserver.io/en/release/intro/specs.html 目 录 ...
- Repeater 控件的嵌套使用
Repeater 控件的嵌套使用 ItemDataBound:数据绑定的时候(正在进行时)发生,多用在Repeater控件嵌套,对子Repeater控件进行数据绑定及模板列中统计列的计算处理等 ...
- nexus-3.2.0-01.zip安装以及如何启动服务
1. 在之前的版本中,启动nexus服务都是在cmd中输入 nexus install来安装服务,nexus start来启动服务. 2. 在nexus-3.2.0-01中,直接在nexus根目录下的 ...
- [MongoDB] MongoDB增删查改
MongoDB的三元素,数据库.集合.文档,集合就是表,文档就是行 开启MongoDB,cd切换到MongoDB的安装目录下的bin目录里,使用命令mongod 开启,参数:--dbpath 路径,把 ...
- Markdown字体大小与颜色
Markdown是一种可以使用普通文本编辑器编写的标记语言,通过类似HTML的标记语法,它可以使普通文本内容具有一定的格式.但是它本身是不支持修改字体.字号与颜色等功能的! CSDN-markdo ...
- java Spring 各版本jar包下载地址
http://repo.spring.io/simple/libs-release-local/org/springframework/
- eclipse使用struts2找不到action方法或找不到action的错误记录
在确认web.xml已经配置, 配置好struts.xml , 代码没有报错, jar包没有问题, 服务器也没有问题, 代码逻辑没有问题, 关键字方法名action都没有写错, 可以运行旧的相同的代码 ...
- blfs(systemv版本)学习笔记-前几章节的脚本配置
我的邮箱地址:zytrenren@163.com欢迎大家交流学习纠错! 记录blfs书籍前几个章节的配置内容. bash shell启动文件章节 1.切换root用户 su 2.创建/etc/prof ...
- RSA key format is not supported
对接支付宝时,提示RSA错误 : 请仔细检查 : 创建支付对象时,关键字参数的名字 如果公私钥是以拼接路径的方式传递给AliPay,正确的关键字参数的名字应该如下 :