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 压缩文件名 源文件:压缩文件 ...
随机推荐
- 从零开始学 Web 之 移动Web(八)Less
大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...
- C++学习总结(2)
1.const指针 指向常量的指针变量,其一般形式为 "const 类型名 * 指针变量名 " . 如下: int a=12,b=15; const int *p=&a; ...
- redis 集群搭建: redis-cluster
前言 redis数据存储在内存中, 就会受到内存的限制, 大家都知道, 一台电脑, 硬盘可以有1T, 但是内存, 没有听说有1T的内存吧. 那如果数据非常多, 超过一台电脑的内存空间, 怎么办呢? 正 ...
- leetcode — integer-to-roman
/** * Source : https://oj.leetcode.com/problems/integer-to-roman/ * * Created by lverpeng on 2017/7/ ...
- server下apache2.4.*虚拟主机配置Forbidden You don't have permission to access / on this server.
前言: 继前面两节笔记之后,在配置一个虚拟主机时,这中间却遇见了一个问题,这里需要描述做一下笔记,刚刚安装的是Ubuntu server,apt-get下来的apache的版本是2.4.7,之前一直用 ...
- netty源码解解析(4.0)-10 ChannelPipleline的默认实现--事件传递及处理
事件触发.传递.处理是DefaultChannelPipleline实现的另一个核心能力.在前面在章节中粗略地讲过了事件的处理流程,本章将会详细地分析其中的所有关键细节.这些关键点包括: 事件触发接口 ...
- Spark2.1.0——内置Web框架详解
Spark2.1.0——内置Web框架详解 任何系统都需要提供监控功能,否则在运行期间发生一些异常时,我们将会束手无策.也许有人说,可以增加日志来解决这个问题.日志只能解决你的程序逻辑在运行期的监控, ...
- [JSOI2010] 连通数
Description Input 输入数据第一行是图顶点的数量,一个正整数N. 接下来N行,每行N个字符.第i行第j列的1表示顶点i到j有边,0则表示无边. Output 输出一行一个整数,表示该图 ...
- c# 对html字符串进行编码
/// <summary> /// 对html字符串进行编码 /// </summary> /// <param name="html">htm ...
- EXISTS 执行顺序
select * from a where a.s_status=1 and exists (select orderid from b where a.orderid=b.orderid) exis ...