📄 data.asp
字号:
<!--#include file =../conn.asp-->
<!--#include file="inc/const.asp"-->
<%
Head()
Dim TestConn,action
Dim admin_flag
Dim dbpath,bkfolder,bkdbname,fso,fso1
Dim uploadpath
Dim okOS,okCpus,okCPU
action=Trim(request("action"))
If Dvbbs.Forum_Setting(76)="0" Or Dvbbs.Forum_Setting(76)="" Then Dvbbs.Forum_Setting(76)="UploadFile/"
uploadpath="../"&Dvbbs.Forum_Setting(76)
Select Case action
Case "CompressData" '压缩数据
admin_flag=",32,"
CheckAdmin(admin_flag)
Dim tmprs,allarticle,Maxid
Dim topic,username,dateandtime,body
Call CompressData()
Case "BackupData" '备份数据
admin_flag=",33,"
CheckAdmin(admin_flag)
If request("act")="Backup" then
Call updata()
Else
Call BackupData()
End If
Case "RestoreData" '恢复数据
admin_flag=",34,"
CheckAdmin(admin_flag)
Dim backpath
If request("act")="Restore" then
Dbpath=Trim(request.form("Dbpath"))
backpath=Trim(request.form("backpath"))
Dbpath = Replace(Dbpath,chr(0),"")
backpath = Replace(backpath,chr(0),"")
If dbpath="" then
response.write "请输入您要恢复成的数据库全名"
Else
Dbpath=server.mappath(Dbpath)
End if
backpath=server.mappath(backpath)
If Lcase(Mid(backpath,instrRev(backpath,".")+1))<>"mdb" Then
response.write "保存数据库名不合法"
Response.End
End If
Set TestConn = Server.CreateObject("ADODB.Connection")
On Error Resume Next
TestConn.open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Dbpath
If Err Then
Response.Write Err.Description
Err.Clear
Set TestConn = Nothing
Response.Write "备份的文件并非合法的数据库。"
Response.End
Else
Set TestConn = Nothing
End If
Set Fso=server.createobject("scripting.filesystemobject")
If fso.fileexists(dbpath) then
fso.copyfile Dbpath,Backpath
response.write "成功恢复数据!"
Else
response.write "备份目录下并无您的备份文件!"
End If
Else
Call RestoreData()
End If
Case "SpaceSize" '系统空间占用
admin_flag=",35,"
CheckAdmin(admin_flag)
Call SpaceSize()
Case Else
Errmsg=ErrMsg + "<BR><li>选取相应的操作。"
dvbbs_error()
End Select
Footer()
response.write"</body></html>"
'====================系统空间占用=======================
sub SpaceSize()
On error resume next
GetSysInfo()
Dim t
't = GetAllSpace
Dim FoundFso
FoundFso = False
FoundFso = IsObjInstalled("Scripting.FileSystemObject")
%>
<table border="0" cellspacing="1" cellpadding="5" height="1" align=center width="100%"><tr>
<th style="text-align:center;" colspan=5>
系统信息检测情况
</th>
</tr>
<tr>
<td class="td1" width="35%" height=23>
当前论坛版本
</td>
<td class="td1" width="15%">
<a href="http://www.dvbbs.net/download.asp" target=_blank>Dvbbs <%=Dvbbs.Forum_Version%></a>
</td>
<td width="8" class="td1"> </td>
<td class="td1" width="35%">
数据库类型:
</td>
<td class="td1" width="15%">
<%
If IsSqlDataBase = 1 Then
Response.Write "Sql Server"
Else
Response.Write "Access"
End If
%>
</td>
</tr>
<tr>
<td class="td2" width="35%" height=23>
服务器名和IP
</td>
<td class="td2" width="15%">
<%=Request.ServerVariables("SERVER_NAME")%><BR><%=Request.ServerVariables("LOCAL_ADDR")%>
</td>
<td width="8" class="td2"> </td>
<td class="td2" width="35%">
数据库占用空间
</td>
<td class="td2" width="15%">
<%
If IsSqlDataBase = 1 Then
Set Rs=Dvbbs.Execute("Exec sp_spaceused")
If Err <> 0 Then
Err.Clear
Response.Write "<font color=gray>未知</font>"
Else
Response.Write Rs(1)
End If
Else
If FoundFso Then
Response.Write GetFileSize(MyDbPath & DB)
Else
Response.Write "<font color=gray>未知</font>"
End If
End If
%>
</td>
</tr>
<tr>
<td class="td1" width="35%" height=23>
上传头像占用空间
</td>
<td class="td1" width="15%">
<%showSpaceinfo("../uploadface")%>
</td>
<td width="8" class="td1"> </td>
<td class="td1" width="35%">
上传图片占用空间
</td>
<td class="td1" width="15%">
<%showSpaceinfo(uploadpath)%>
</td>
</tr>
<tr>
<td class="td2" width="100%" height=23 colspan=5>
<B>服务器相关信息</B>
</td>
</tr>
<tr>
<td class="td1" width="35%" height=23>
ASP脚本解释引擎
</td>
<td class="td1" width="15%">
<%=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion %>
</td>
<td width="8" class="td1"> </td>
<td class="td1" width="35%">
IIS 版本
</td>
<td class="td1" width="15%">
<%=Request.ServerVariables("SERVER_SOFTWARE")%>
</td>
</tr>
<tr>
<td class="td2" width="35%" height=23>
服务器操作系统
</td>
<td class="td2" width="15%">
<%=okos%>
</td>
<td width="8" class="td2"> </td>
<td class="td2" width="35%">
服务器CPU数量
</td>
<td class="td2" width="15%">
<%=okcpus%> 个
</td>
</tr>
<tr>
<td class="td1" width="100%" height=23 colspan=5>
本文件路径:<%=Server.Mappath("data.asp")%>
</td>
</tr>
<tr>
<td class="td2" width="100%" colspan=5 height=23>
<B>主要组件信息</B>
</td>
</tr>
<tr>
<td class="td1" width="35%" height=23>
FSO文件读写
</td>
<td class="td1" width="15%">
<%
If FoundFso Then
Response.Write "<font color=green><b>√</b></font>"
Else
Response.Write "<font color=red><b>×</b></font>"
End If
%>
</td>
<td width="8" class="td1"> </td>
<td class="td1" width="35%">
Jmail发送邮件支持
</td>
<td class="td1" width="15%">
<%
If IsObjInstalled("JMail.SmtpMail") Then
Response.Write "<font color=green><b>√</b></font>"
Else
Response.Write "<font color=red><b>×</b></font>"
End If
%>
</td>
</tr>
<tr>
<td class="td2" width="35%" height=23>
CDONTS发送邮件支持
</td>
<td class="td2" width="15%">
<%
If IsObjInstalled("CDONTS.NewMail") Then
Response.Write "<font color=green><b>√</b></font>"
Else
Response.Write "<font color=red><b>×</b></font>"
End If
%>
</td>
<td width="8" class="td2"> </td>
<td class="td2" width="35%">
AspEmail发送邮件支持
</td>
<td class="td2" width="15%">
<%
If IsObjInstalled("Persits.MailSender") Then
Response.Write "<font color=green><b>√</b></font>"
Else
Response.Write "<font color=red><b>×</b></font>"
End If
%>
</td>
</tr>
<tr>
<td class="td1" width="35%" height=23>
无组件上传支持
</td>
<td class="td1" width="15%">
<%
If IsObjInstalled("Adodb.Stream") Then
Response.Write "<font color=green><b>√</b></font>"
Else
Response.Write "<font color=red><b>×</b></font>"
End If
%>
</td>
<td width="8" class="td1"> </td>
<td class="td1" width="35%">
AspUpload上传支持
</td>
<td class="td1" width="15%">
<%
If IsObjInstalled("Persits.Upload") Then
Response.Write "<font color=green><b>√</b></font>"
Else
Response.Write "<font color=red><b>×</b></font>"
End If
%>
</td>
</tr>
<tr>
<td class="td2" width="35%" height=23>
SA-FileUp上传支持
</td>
<td class="td2" width="15%">
<%
If IsObjInstalled("SoftArtisans.FileUp") Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -