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 压缩文件名 源文件:压缩文件 ...
随机推荐
- PHP的UTF-8中文转拼音处理类
<?php /** * PHP 汉字转拼音 * @author Jerryli(hzjerry@gmail.com) * @version V0.20140715 * @package SPFW ...
- SQL优化原则(转)
一.问题的提出 在应用系统开发初期,由于开发数据库数据比较少,对于查询SQL语句,复杂视图的的编写等体会不出SQL语句各种写法的性能优劣,但是如果将应用系统提交实际应用后,随着数据库中数据的增加,系统 ...
- 深度学习论文翻译解析(二):An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
论文标题:An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application ...
- The Mac App Store isn't working. How to fix?
Q. The Mac App Store isn't working. How to fix? First you must have built-in Ethernet at 'en0'. So, ...
- [转]angular2在运行ng serve的时候卡在95% emitting LicenseWebpackPlugin
本文转自:https://blog.csdn.net/qq919694688/article/details/80912207 放弃使用cnpm,使用yarn 1.删除node_modules (不需 ...
- elasticsearch6.7 05. Document APIs(9)Bulk API
8.Bulk API 可以把多个index或delete操作放在单个bulk API中执行.这样可以极大地提高索引速度. /_bulkAPI使用如下的JSON结构: action_and_meta_d ...
- Design--源自生活美学的色彩搭配网站(design-seeds)
All the flowers of all the tomorrows are in the seeds of today. 色彩搭配网站--design-seeds.com // 所有的颜色值都是 ...
- linux学习笔记-文件相关知识
我的邮箱地址:zytrenren@163.com欢迎大家交流学习纠错! 一.文件属性 在当前用户家目录下以ls -al命令输出为例: -rw-r--r-- 1 renren ...
- 理解jQuery中$.get、$.post、$.getJSON和$.ajax的用法
ajax的4种方法:$.get.$.post.$getJSON.$ajax. 1.$.get $.get()方法使用GET方式来进行异步请求,它的语法结构为: $.get( url [, data] ...
- ionic 项目签名
一.ionic 自动签名的好处与坏处(ionic build android/ios) 好处在于:可以直接安装手机上进行安装测试,也可以上传Android或者iOS平台 不好的地方在于:你的电脑环境 ...