① 如何實現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