www.gusucode.com > 25175 学生同学录管理系统 2007 build 1231D源码程序 > admin/admin_data.asp
<!--#include file="../conn.asp"--> <!--#include file="../inc/inc.asp"--> <!--#include file="inc/inc.asp"--> <!--#include file="common/admin_data_inc.asp"--> <% res w3chead(""),1 nowtit="数据库" Login_Judge powerid=103 restit nowtit,"信息维护" Dim ZC_DATABASE_PATH Dim size_n Dim data_array Dim bkfolders '数据库的路径 ZC_DATABASE_PATH=DataPath data_array= Split(ZC_DATABASE_PATH,"/") action=trim(request("action")) Dim dbpath,bkfolder,bkdbname,fso,fso1 Select Case action Case "" Case "CompressData" '压缩数据 Ispower powerid & "3" nowmenu Dim tmprs dim allarticle dim Maxid dim topic,username,dateandtime,body CompressData case "BackupData" '备份数据 Ispower powerid & "1" nowmenu if request("act")="Backup" Then updata else BackupData end If case "RestoreData" '恢复数据 Ispower powerid & "2" nowmenu dim backpath if request("act")="Restore" Then Dbpath=request.form("Dbpath") backpath="../"&ZC_DATABASE_PATH if dbpath="" Then response.write "Please input your database whole Name" else Dbpath=server.mappath(Dbpath) end If backpath=server.mappath(backpath) Set Fso=server.CreateObject("scripting.filesystemobject") if fso.fileexists(dbpath) Then fso.copyfile Dbpath,Backpath rightmsg "","数据库被成功还原!<br>" else errormsg "没找到您所需要的数据库!" end If else call RestoreData() end If Case "SpaceSize" '系统空间占用 nowmenu SpaceSize Case "deletebackup" Ispower powerid & "2" nowmenu Dim dbname dbpath=Request.QueryString("dbpath") dbname=Request.QueryString("dbname") dbpath=Server.MapPath(dbpath) dbpath=dbpath &"\"&dbname set fso = CreateObject("Scripting.FileSystemObject") If fso.FileExists(dbPath) Then fso.DeleteFile(DBPath) Set fso = nothing rightmsg "?action=BackupData","您备份的数据库已经" & dbpath &"被成功删除!" Else response.write dbpath errormsg "输入的路径错误,请确认后重新输入!" End If Case Else End Select res footer(1),0 %>