📄 admin_data.asp
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/getPartStrAndBytesLen.asp"-->
<!--#include file="fyasp_mange_check.asp"-->
<%
'┌─ 风云ASP在线 ────────────────────────┐
'│ │
'│ 作者:赵振波. http://www.fyasp.com │
'│ │
'│ Q Q:185623333 │
'│ │
'│ Email:fy96@163.com │
'│ │
'│ 程序定做,系统开发,网站制作,提供高质量的网络产品、技术和服务!│
'│ │
'│【版权声明】 │
'│ │
'│ 本程序版权归坐看风云所有,未经授权擅自修改、复制或散布本程序│
'│ │
'│的部分或全部,将承受严厉的民事和刑事处罚,对已知的违反者将给予法 │
'│ │
'│律范围内的全面制裁。对非法使用此程序所造成的一切后果本人概不负责!│
'│ │
'└─────────────────── http://www.fyasp.com ──┘
'option explicit
response.buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
dim Action,DataBackPath
DataBackPath="backdb" '备份目录
Action=Trim(request("Action"))
dim ObjInstalled
ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")
%>
<html>
<head>
<title>数据库管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../ht.css" type="text/css">
<STYLE>
body { background:#d6dff7; font-size: 12px; margin-top:0px;
SCROLLBAR-FACE-COLOR: #AABFEC; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff;
SCROLLBAR-SHADOW-COLOR: #ffffff; SCROLLBAR-DARKSHADOW-COLOR: #AABFEC;
SCROLLBAR-3DLIGHT-COLOR: #AABFEC; SCROLLBAR-ARROW-COLOR: #def0fa;
SCROLLBAR-TRACK-COLOR: #def0fa;
}
TD {
FONT-SIZE: 12px
}
INPUT {
FONT-SIZE: 12px;
HEIGHT: 20px;
}
Button
{
FONT-SIZE: 9pt;
HEIGHT: 20px;
}
Select
{
FONT-SIZE: 9pt;
HEIGHT: 20px;
}
A
{
TEXT-DECORATION: none;
color: #000000;
}
A:hover
{
COLOR: #428EFF;
text-decoration: underline;
}
th
{
FONT-WEIGHT: bold; FONT-SIZE: 12px; BACKGROUND-COLOR: #799AE1; Height: 20; COLOR: white;
}
.title
{
FONT-WEIGHT: bold; FONT-SIZE: 12px; BACKGROUND-COLOR: #799AE1; Height: 20; COLOR: white;
}
.border
{
BORDER-RIGHT: #AABFEC 1px solid; BORDER-TOP: #AABFEC 1px solid; BORDER-LEFT: #AABFEC 1px solid; WIDTH: 99%; BORDER-BOTTOM: #AABFEC 1px solid; BACKGROUND-COLOR: #ffffff
}
.tdbg{
PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BACKGROUND: #DEF0FA; PADDING-BOTTOM: 3px; PADDING-TOP: 3px
}
.tdbg2{
PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BACKGROUND: #C8E7F7; PADDING-BOTTOM: 3px; PADDING-TOP: 3px
}
</STYLE>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="title">
<td height="22" colspan="2" align="center"><strong>数 据 库 管 理</strong></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30"><a href="Admin_Data.asp?Action=Backup">备份数据库</a> | <a href="Admin_Data.asp?Action=Restore">恢复数据库</a>
| <a href="Admin_Data.asp?Action=Compact">压缩数据库</a>
| <a href="Admin_Data.asp?Action=ServerInfo">服务器信息</a>
| <a href="Admin_Data.asp?Action=SpaceSize">系统空间占用</a> |
<a href="Admin_Data.asp">风云房产功能介绍</a></td>
</tr>
</table>
<%if session("ADMIN")="1" then
Select Case Action
Case "Backup"
call ShowBackup()
Case "BackupData"
call ShowBackup()
Case "Compact"
call ShowCompact()
Case "CompactData"
call ShowCompact()
Case "Restore"
call ShowRestore()
Case "RestoreData"
call ShowRestore()
Case "DelBackup"
call ShowRestore()
Case "Init"
call ShowInit()
Case "Clear"
call ShowInit()
Case "SpaceSize"
GetSpaceInfo()
Case "ServerInfo"
Call ServerInfo()
Case "DoSqlMain"
call DoSqlMain()
Case "DoSql"
call DoSql()
Case else
call Showjs()
End Select
else
call Showjs()
end if
if FoundErr=True then
response.write "<br><br>发生错误!"
end if
sub showjs%><br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<form method="post" action="Admin_Data.asp?action=BackupData">
<tr class="title">
<td align="center" height="22" valign="middle">风云房产功能介绍</td>
</tr>
<tr class="tdbg">
<td height="150" align="center" valign="middle">
<table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr>
<td height="107" align="center">
<img border="0" src="../房产功能介绍.jpg" width="554" height="6418"></td>
</tr>
</table>
<%
end sub
Sub ShowBackup()
if datebasetype=1 then
Call SQLUserReadme()
else
%>
<br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<form method="post" action="Admin_Data.asp?action=BackupData">
<tr class="title">
<td align="center" height="22" valign="middle"><b>备 份 数 据 库</b></td>
</tr>
<tr class="tdbg">
<td height="150" align="center" valign="middle">
<%
if Action="BackupData" then
call backupdata()
else
%>
<table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr>
<td width="200" height="33" align="right">备份目录:</td>
<td><input type="text" size="20" name="bkfolder" value="<%=DataBackPath%>" ReadOnly></td>
<td>如要修改备份目录,请在此文件第8行处更改。</td>
</tr>
<tr>
<td width="200" height="34" align="right">备份名称:</td>
<td height="34"><input type=text size=20 name=bkDBname value="<%=replace(replace(date&time,":",""),"-","")%>_Bak"></td>
<td height="34">不用输入文件名后缀(默认为“.mdb”)。如有同名文件,将覆盖</td>
</tr>
<tr align="center">
<td height="40" colspan="3"><input name="submit" type=submit value=" 开始备份 " <%If ObjInstalled=False Then response.Write "disabled"%>></td>
</tr>
</table>
<%
If ObjInstalled=False Then
Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
end if
end if
%>
</td>
</tr>
</form>
</table>
<%
end if
end sub
sub ShowCompact()
if IsSqlDataBase=1 then
Call SQLUserReadme()
else
%>
<br>
<table class="border" width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr class="title">
<td align="center" height="22" valign="middle"><b>数据库在线压缩</b></td>
</tr>
<tr class="tdbg">
<td align="center" height="150" valign="middle">
<%
if Action="CompactData" then
call CompactData()
else
%>
<br>
<br>
<br>
压缩前,建议先备份数据库,以免发生意外错误。 <br>
<br>
<br>
<form name="form1" method="post" action="Admin_Data.asp?action=CompactData">
<input name="submit1" type=submit value=" 压缩主数据库 " <%If ObjInstalled=False Then response.Write "disabled"%>>
</form>
<br>
<%
If ObjInstalled=False Then
Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
end if
end if
%>
</td>
</tr>
</table>
</form>
<%
end if
end sub
sub ShowRestore()
if is_sqldata=1 then
Call SQLUserReadme()
else
%>
<br>
<table width="100%" class="border" border="0" align="center" cellpadding="0" cellspacing="1">
<tr class="title">
<td align="center" height="22" valign="middle"><b>数据库恢复</b></td>
</tr>
<tr class="tdbg">
<td align="center" valign="middle">
<%
if Action="RestoreData" then
call RestoreData()
elseif Action="DelBackup" then
Call DelBackup()
else
Dim Fso
Set Fso=server.createobject("Scripting.FileSystemObject")
dim theFolder,theFile,strFileType
if Not fso.FolderExists(Server.MapPath(DataBackPath)) then
response.write "找不到数据库备份文件夹("&DataBackPath&")!"
response.end
end if
Set theFolder=fso.GetFolder(Server.MapPath(DataBackPath))
For Each theFile In theFolder.Files
strFileType=lcase(mid(theFile.Name,instrrev(theFile.Name,".")+1))
if strFileType="mdb" Then
%>
<br>
<fieldset><legend align="center"><strong><%=theFile.Name%></strong></legend>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<tr class="tdbg">
<td align="right">文 件 名:</td>
<td><font color=#ff6600><%=theFile.Name%></font></td>
<td align="right">文件大小:</td>
<td><%=round(theFile.size/1024) & " K"%></td>
<td align="right">修改时间:</td>
<td><%=theFile.DateLastModified%></td>
</tr>
<tr class="tdbg">
<td align="right">操作选项:</td>
<td colspan="5" valign="middle">
<form method="Post" action="Admin_Data.asp?action=RestoreData" onsubmit="return confirm('确定恢复数据库吗?,此操作将替换现在使用中的数据库!');">
<input name="backpath" type="text" id="backpath" value="<%=DataBackPath%>\<%=theFile.Name%>" size=50 maxlength="200" readonly>
<input name="submit" type="submit" value=" 恢复数据 " <%If ObjInstalled=False Then response.Write "disabled"%>>
</form>
<form method="Post" action="Admin_Data.asp?action=DelBackup" onsubmit="return confirm('确定删除备份文件吗?');">
<input name="Document" type="text" id="Document" value="<%=DataBackPath%>\<%=theFile.Name%>" size=50 maxlength="200" readonly>
<input name="Del" type="submit" value=" 删除备份 " <%If ObjInstalled=False Then response.Write "disabled"%>>
</form>
</td>
</tr>
</table>
</fieldset>
<%
end if
Next
If ObjInstalled=False Then
Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
end if
end if
%>
</td>
</tr>
</table>
<%
end if
end sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -