zipfox.asp

来自「中国网站网贴吧程序源码(ASP+ACCESS) 实现功能: 多级分类查找,可按多」· ASP 代码 · 共 92 行

ASP
92
字号
<!--#include file="../conn/boardconn.asp"-->
<!--#include file="../style/sql.asp" -->
<!--#include file="../CHAR.INC"-->
<!--#include file="../function.asp"-->
<%
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
response.write "<br><br><center><table border=1 cellpadding=20 bordercolor=black bgcolor=#EEEEEE width=450>"
response.write "<tr><td style=font:9pt Verdana>"
response.write "<center><font face=Georgia,Tahoma size=2><u>友情提示:服务器禁止非法操作...</u></font></center>"
response.write "</td></tr></table></center>"
response.end
end if
%>
<%
fqys=request.servervariables("query_string") 
dim nothis(18) 
nothis(0)="net user" 
nothis(1)="xp_cmdshell" 
nothis(2)="/add" 
nothis(3)="exec%20master.dbo.xp_cmdshell" 
nothis(4)="net localgroup administrators" 
nothis(5)="select" 
nothis(6)="count" 
nothis(7)="asc" 
nothis(8)="char" 
nothis(9)="mid" 
nothis(10)="'" 
nothis(11)=":" 
nothis(12)="""" 
nothis(13)="insert" 
nothis(14)="delete" 
nothis(15)="drop" 
nothis(16)="truncate" 
nothis(17)="from" 
nothis(18)="%" 
errc=false 
for i= 0 to ubound(nothis) 
if instr(FQYs,nothis(i))<>0 then 
errc=true 
end if 
next 
if errc then 
response.write "<br><br><center><table border=1 cellpadding=20 bordercolor=black bgcolor=#EEEEEE width=450>"
response.write "<tr><td style=font:9pt Verdana>"
response.write "<center><font face=Georgia,Tahoma size=2><u>友情提示:服务器禁止非法操作...</u></font></center>"
response.write "</td></tr></table></center>"
response.end 
end if 
%>
<%CheckAdmin1%>
<%
if Request.QueryString("action")="Zip" Then

Dim dbpath,boolIs97
dbpath = request("dbpath")
boolIs97 = request("boolIs97")

If dbpath <> "" Then
       dbpath = server.mappath(dbpath)
       response.write(CompactDB(dbpath,boolIs97))
End If

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 = "<br><br><center><table border=1 cellpadding=20 bordercolor=black bgcolor=#EEEEEE width=450><tr><td style=font:9pt Verdana><center><font face=Georgia,Tahoma size=2>友情提示:数据库压缩完毕,您备份的数据库路径" & dbpath & "</font><br><br><a href=""#"" onClick=""javascript:history.go(-1);""><font face=Georgia,Tahoma size=2>返回压缩页面</font></center></td></tr></table></center>" & vbCrLf
Else
       CompactDB = "<br><br><center><table border=1 cellpadding=20 bordercolor=black bgcolor=#EEEEEE width=450><tr><td style=font:9pt Verdana><center><font face=Georgia,Tahoma size=2>友情提示:找不到您所需要压缩的数据库文件...</font><br><br><a href=""#"" onClick=""javascript:history.go(-1);""><font face=Georgia,Tahoma size=2>返回压缩页面</font></center></td></tr></table></center>" & vbCrLf
End If
End Function
end if
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?