<%
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\
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
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
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在线压缩和解压缩文件(文件夹)的更多相关文章

  1. [Java 基础] 使用java.util.zip包压缩和解压缩文件

    reference :  http://www.open-open.com/lib/view/open1381641653833.html Java API中的import java.util.zip ...

  2. IOS开发之网络编程--文件压缩和解压缩

    前言: QQ表情包就用到了解压缩,从网络下载的那么多表情文件格式并不是一个一个图片文件,而是多个图片压缩而成的表情压缩包.下面介绍的是iOS开发中会用到的压缩和解压缩的第三方框架的使用. 注意: 这个 ...

  3. iOS中使用ZipArchive压缩和解压缩文件-备

    为什么我需要解压缩文件 有许多原因能解释为什么我要在工程中使用压缩和解压缩功能,下面是几个常见的原因: 苹果App Store的50M下载限制 苹 果公司出于流量的考虑,规定在非WIFI环境下,限制用 ...

  4. IO操作之使用zip包压缩和解压缩文件

    转自:http://www.cdtarena.com/java.html​​Java API中的import java.util.zip.*;包下包含了Java对于压缩文件的所有相关操作. 我们可以使 ...

  5. Java用ZIP格式压缩和解压缩文件

    转载:java jdk实例宝典 感觉讲的非常好就转载在这保存! java.util.zip包实现了Zip格式相关的类库,使用格式zip格式压缩和解压缩文件的时候,须要导入该包. 使用zipoutput ...

  6. 使用commons-compress操作zip文件(压缩和解压缩)

    http://www.cnblogs.com/luxh/archive/2012/06/28/2568758.html Apache Commons Compress是一个压缩.解压缩文件的类库. 可 ...

  7. C# 利用ICSharpCode.SharpZipLib.dll 实现压缩和解压缩文件

    我们 开发时经常会遇到需要压缩文件的需求,利用C#的开源组件ICSharpCode.SharpZipLib, 就可以很容易的实现压缩和解压缩功能. 压缩文件: /// <summary> ...

  8. ios开发网络学习五:MiMEType ,多线程下载文件思路,文件的压缩和解压缩

    一:MiMEType:一般可以再百度上搜索到相应文件的MiMEType,或是利用c语言的api去获取文件的MiMEType : //对该文件发送一个异步请求,拿到文件的MIMEType - (void ...

  9. C# - WinFrm应用程序调用SharpZipLib实现文件的压缩和解压缩

    前言 本篇主要记录:VS2019 WinFrm桌面应用程序调用SharpZipLib,实现文件的简单压缩和解压缩功能. SharpZipLib 开源地址戳这里. 准备工作 搭建WinFrm前台界面 添 ...

  10. Linux常用命令学习3---(文件的压缩和解压缩命令zip unzip tar、关机和重启命令shutdown reboot……)

    1.压缩和解压缩命令    常用压缩格式:.zip..gz..bz2..tar.gz..tar.bz2..rar .zip格式压缩和解压缩命令        zip 压缩文件名 源文件:压缩文件   ...

随机推荐

  1. springboot shiro开启注释

    shiroconfiguration中增加 @Bean public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceA ...

  2. MapReduce-深度剖析

    1.概述 在接触了第一代MapReduce和第二代MapReduce之后,或许会有这样的疑惑,我们从一些书籍和博客当中获取MapReduce的一些原理和算法,在第一代当中会有JobTrack,Task ...

  3. 音频标签化3:igor-8m项目的训练、评估与测试

    上一节介绍了youtube-8m项目,这个项目以youtube-8m dataset(简称8m-dataset)样本集为基础,进行训练.评估与测试.youtube-8m设计用于视频特征样本,但实际也适 ...

  4. Makefile.am文件配置

    Makefile.am Makefile.am是一种比Makefile更高层次的编译规则,可以和configure.in文件一起通过调用automake命令,生成Makefile.in文件,再调用./ ...

  5. winform 窗体关闭枚举类

    switch (e.CloseReason) { case CloseReason.None: break; case CloseReason.WindowsShutDown: break; case ...

  6. CSS兼容性(IE和Firefox)技巧

    CSS对浏览器的兼容性有时让人很头疼,或许当你了解当中的技巧跟原理,就会觉得也不是难事,从网上收集了IE7,6与Fireofx的兼容性处理技巧并整理了一下.对于web2.0的过度,请尽量用xhtml格 ...

  7. mybatis中动态SQL之trim详解

    一. 背景 之前mybatis中<where>.<update>.<if>.<foreach>标签用的多,知道有<trim>这个标签,但很少 ...

  8. 牛刀小试MySQL--GTID

    GTID的概念 何为GITD GTID(global transaction identifier)是全局事务标识符,在MySQL5.6版本中作为一个超级特性被推出.事务标识不仅对于Master(起源 ...

  9. 服务器CPU居高不下--解决问题历程

    基本的概述 在一个服务器的集群上面,服务器的CPU长时间居高不下,响应的时间也一直很慢,即使扩容了服务器CPU的下降效果也不是很明显. 对于CPU过高的原因,可以总结到以下原因: 太多的循环或者死循环 ...

  10. linux shell脚本之-变量极速入门与进阶(1)

    1,如果创建shell脚本? 使用任意文本编辑软件,一般为vim,创建.sh结尾的文件,在文件的最开头用 #!/bin/bash 注明shell的类型 如: ghostwu@dev:~/linux/s ...