① 如何实现asp在线压缩多个文件
<%
'ClassicASPCSVcreator0.3
'ByRCDMK<
[email protected]
>
'
'TheMITLicense(MIT)-
http://opensource.org/licenses/MIT
'Copyright(c)2012RCDMK<
[email protected]
>
'
'Permissionisherebygranted,freeofcharge,
'associateddocumentationfiles(the"Software"),,
',,modify,merge,publish,distribute,
'sublicense,and/orsellcopiesoftheSoftware,
'furnishedtodoso,:
'
'substantial
'portionsoftheSoftware.
'
'THESOFTWAREISPROVIDED"ASIS",WITHOUTWARRANTYOFANYKIND,EXPRESSORIMPLIED,INCLUDINGBUT
',
'NONINFRINGEMENT.,
'DAMAGESOROTHERLIABILITY,WHETHERINANACTIONOFCONTRACT,TORTOROTHERWISE,ARISINGFROM,OUT
'.
classaspZip
dimBlankZip,NoInterfaceYesToAll
dimfso,curArquieve,created,saved
dimfiles,m_path,zipApp,zipFilepublicpropertygetCount()
Count=files.Count
Path=m_path
endproperty
privatesubclass_initialize()
BlankZip=Chr(80)&Chr(75)&Chr(5)&Chr(6)&String(18,0)'Createtheblankfilestructure
NoInterfaceYesToAll=4or16or1024'
http://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx'initializecomponents
setfso=createObject("scripting.filesystemobject")
setfiles=createObject("Scripting.Dictionary")SetzipApp=CreateObject("Shell.Application")
endsubprivatesubclass_terminate()
'somecleanup
setcurArquieve=nothing
setzipApp=nothing
setfiles=nothing',deleteit
'sinceitsempty
ifcreatedandnotsavedthen
onerrorresumenext
fso.deleteFilem_path
onerrorgoto0
endifsetfso=nothing
endsub
'Opensorcreatesthearquieve
publicsubOpenArquieve(byvalpath)
dimfile
'
path=replace(path,"/","")
m_path=Server.MapPath(path)''texists
ifnotfso.fileexists(m_path)then
setfile=fso.createTextFile(m_path)
file.writeBlankZip
file.close()
setfile=nothingsetcurArquieve=zipApp.NameSpace(m_path)
created=true
else
'dimcnt
setcurArquieve=zipApp.NameSpace(m_path)cnt=0
foreachfileincurArquieve.Items
cnt=cnt+1
files.addfile.path,cnt
next
endif
saved=false
endsub
'Addafileorfoldertothelist
publicsubAdd(byvalpath)
path=replace(path,"/","")
ifinstr(path,":")=0thenpath=Server.mappath(path)ifnotfso.fileExists(path)andnotfso.folderExists(path)then
err.raise1,"Filenotexists","Theinputfilenamedoen'tcorrespondtoanexistingfile"elseifnotfiles.exists(path)Then
files.addpath,files.Count+1
endif
endsub'()
publicsubRemove(byvalpath)
iffiles.exists(path)thenfiles.Remove(path)
endsub'Clearthetobeaddedlist
publicsubRemoveAll()
files.RemoveAll()
endsub'Writesthetothearquieve
publicsubCloseArquieve()
dimfilepath,file,initTime,fileCount
dimcnt
cnt=0
ForEachfilepathInfiles.keys
'
ifinstr(filepath,m_path)=0then
curArquieve.Copyherefilepath,NoInterfaceYesToAll
fileCount=curArquieve.items.Count'
OnErrorResumeNext
'DoUntilfileCount<curArquieve.Items.Count
wscript.sleep(10)
cn=cnt+1
'Loop
OnErrorGoTo0
endif
nextsaved=true
endsub
publicsubExtractTo(byvalpath)
iftypeName(curArquieve)="Folder3"Then
path=Server.MapPath(path)ifnotfso.folderExists(path)then
fso.createFolder(path)
endifzipApp.NameSpace(path).CopyHerecurArquieve.Items,NoInterfaceYesToAll
endif
endsub
endclass
%>
使用方法
<%
optionexplicit
Server.scriptTimeout=1
%>
<!--#includefile="aspZip.class.asp"-->
<%
dimzip,filepath
filepath="test.zip"
setzip=newaspZip
zip.OpenArquieve(filepath)
'zip.Add(".img")
zip.Add(".qrcode.asp")
zip.CloseArquieve()
zip.ExtractTo(". est")
setzip=nothing
%>
OK
② asp如何压缩access2003
利用一个引擎DLL
<div><br>
<div align="center">运行环境:在WIN98SE+PWS、WIN2000+IIS5.0 <br>
<%
Const JET_3X = 4
Function CompactDB(dbPath, boolIs97)
Dim fso, Engine, strDBPath
strDBPath = left(dbPath,instrrev(DBPath,"\"))
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(dbPath) Then
Set Engine = CreateObject("JRO.JetEngine")
If boolIs97 = "True" Then
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & dbpath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath &
"temp.mdb;" _
& "Jet OLEDB:Engine Type=" & JET_3X
Else
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & dbpath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath &
"temp.mdb"
End If
fso.CopyFile strDBPath & "temp.mdb",dbpath
fso.DeleteFile(strDBPath & "temp.mdb")
Set fso = nothing
Set Engine = nothing
CompactDB = "你的数据库, " & dbpath & ", 已经被压缩" & vbCrLf
Else
CompactDB = "你输入的数据库路径或名称未找到,请重试" & vbCrLf
End If
End Function
%>
</div>
</div>
<form name="compact" method="post" action="compact.asp">
<div align="center"><font size="2"><b>
<font color="#FF0000">压缩选项,请仔细填写!</font></b><br>
<br>
输入数据库全称:
<input type="text" name="dbpath">
(包括扩展名,如MDB、ASA、ASP等)<br>
<br>
<input type="checkbox" name="boolIs97" value="True">
检查是否为ACCESS97数据库<br>
(默认为ACCESS2000的数据库)<br>
<br>
<input type="submit" name="submit" value="确认压缩">
</font></div>
</form>
<div align="center"><font size="2">
<%
Dim dbpath,boolIs97
dbpath = request("dbpath")
boolIs97 = request("boolIs97")
If dbpath <> "" Then
dbpath = server.mappath(dbpath)
response.write(CompactDB(dbpath,boolIs97))
End If
%>
<br>
</font></div>
③ 我下载了一个.asp的压缩文件应该用什么解压
那你看看这个文件有多大,如果很小的话, 就说明不是压缩文件,而是你要下载的东西的链接页面,因为.asp格式的文件的确是网页文件。你用notepad打开看一下是不是html代码。
④ 如何让asp自动压缩图片大小
float k;
k=Img.Width/Img.Height;
if(Img.Width>Img.Height)
{
Img.Width=500;Img.Height=Convert.ToInt32(Convert.ToSingle(500)/k);
}
else
{
Img.Height=500;Img.Width=Convert.ToInt32(Convert.ToSingle(500)*k);
}
⑤ asp能不能使用gzip压缩页面大小
1.减少网页代码 使用Div+Csss
2.首页静态化 打开的就快了
⑥ asp网站用的access数据库怎么在线压缩数据库
压缩数据库只能用单人打开方式,在选项里面有一个以什么方式关闭数据库。
⑦ 请教如何通过代码实现ASP网站GZIP压缩
asp 实现winrar压缩
<%
dim ylj,ywj,Mlpath,Shell,rarcomm,RetCode,cmd,comm,fso
Mlpath="E:\page\mian\"'存放RAR.EXE和CMD.EXE的路径
ylj=Server.mappath("mian")&"\"'解压文件后所放的路径
ywj=Server.mappath("mian\apathy.rar")'要解压的RAR文件
Set Shell = Server.CreateObject("WScript.Shell")
rarcomm= "E:\page\mian\cmd.exe /c "&Mlpath&"rar.exe x -t -o+ -p- "
cmd=rarcomm&ywj&" "&ylj
RetCode = Shell.Run(cmd,1, True)
%>
⑧ ASP怎样实现网页gzip压缩
第一:利用GZIP压缩网页来提升网站浏览速度, 这个不是所有的网站都适用的 因为开启GZIP压缩,是牺牲服务器性能来达到的..会对服务器产生额外的开销..所以要看你服务器的性能是否满足 一.IIS6.0开启方法: 1.双击IIS服务器,右键点击网站,点击属性...
⑨ 关于ASP自动解压缩 压缩文件的问题
1、 是不是什么文件都可以压缩?
答:压缩是可以,但有些可执行文件解压后并不能运行。
可执行程序文件或软件安装文件可以压缩吗?还是必须放进文件夹里才能压缩?
答:可执行程序文件可以直接压缩。
软件安装文件必须放进文件夹里压缩,否则解压后程序不能正常运行。
2、 一般的压缩比例是多少?什么的文件压缩比例小?小到什么程度?
答:你用WinRAR软件,有压缩比例测试,一目了然。
3、 如何制作含有解压密码的压缩文件?
答:打开winrar,选择你要压缩的文件,点工具栏上的添加-选择“高级”选项-设置密码。
4、 如何破解不知道密码的压缩文件?
答:Advanced ZIP Password Recovery 3.52可以解开ZIP压缩文件的密码;
Advanced RAR Password Recovery 1.10可以解开RAR压缩文件的密码。
5、 除了winrar和winzip外还有哪些常用的压缩解压工具?
答:winace