复制代码 代码如下:html head
meta”Content-Language”content=”zh-cn”
meta”Content-Type”content=”text/html;charset=gb2312″
title数据库管理/title /head body divalign=center数据库管理系统/div br br
palign=”center” % DimZC_DATABASE_PATH ‘数据库的路径
ZC_ACCESS数据库的压缩,备份,还原,下载,删除的实现。DATABASE_PATH=”database/data.mdb”
data_ACCESS数据库的压缩,备份,还原,下载,删除的实现。array=Split(ZC_ACCESS数据库的压缩,备份,还原,下载,删除的实现。DATABASE_PATH,”/”) Dimaction
action=trim(request(“action”)) Dimdbpath,bkfolder,bkdbname,fso,fso1
SelectCaseaction Case”” Callchushihua() Case”CompressData”‘压缩数据
Dimtmprs dimallarticle dimMaxid dimtopic,username,dateandtime,body
callCompressData() case”BackupData”‘备份数据
ifrequest(“act”)=”Backup”Then callupdata() else callBackupData() endIf
case”RestoreData”‘恢复数据 dimbackpath ifrequest(“act”)=”Restore”Then
Dbpath=request.form(“Dbpath”) backpath=request.form(“backpath”)
ifdbpath=””Then response.write”PleaseinputyourdatabasewholeName” else
Dbpath=server.mappath(Dbpath) endIf backpath=server.mappath(backpath)
SetFso=server.CreateObject(“scripting.filesystemobject”)
iffso.fileexists(dbpath)Then fso.copyfileDbpath,Backpath
response.write”数据库被成功还原!br” else
response.write”没找到您所需要的数据库!” endIf else callRestoreData()
endIf Case”SpaceSize”‘系统空间占用 callSpaceSize() Case”deletebackup”
Dimdbname dbpath=Request.QueryString(“dbpath”)
dbname=Request.QueryString(“dbname”) dbpath=Server.MapPath(dbpath)
dbpath=dbpath&””&dbname
setfso=CreateObject(“Scripting.FileSystemObject”)
Iffso.FileExists(dbPath)Then fso.DeleteFile(DBPath) Setfso=nothing
response.write”br您备份的数据库已经”&dbpath&”被成功删除!brbrahref=””data_s.asp””返回../a”
Else response.writedbpath
response.write”br输入的路径错误,请确认后重新输入!brbrahref=””data_s.asp””返回../a”
EndIf CaseElse EndSelect % /div % response.write”/body/html”
Subchushihua() % divalign=center form br/
ahref=”?action=CompressData”[压缩数据库]/a
br/br/ahref=”?action=BackupData”[备份数据库]/a
br/br/ahref=”?action=RestoreData”[俄罗斯贵宾会,还原数据库]/a
br/br/ahref=”?action=SpaceSize”[系统空间占用]/a br/br/ /form /div
%endsub% % ‘====================系统空间占用=======================
SubSpaceSize() OnErrorResumeNext % divalign=center divalign=center
系统空间查看 br/br/ form br
数据库:%showSpaceinfo(“../”&data_array(1)&””)%brbr
备份数据库:%showSpaceinfo(“databackup”)%brbr
系统总共:%showSpaceinfo(“/”)% brbr /form /div br br br
ahref=”data_s.asp”返回…/a /div % EndSub % %SubShowSpaceInfo(drvpath)
dimfso,d,size,showsize
setfso=server.CreateObject(“scripting.filesystemobject”)
drvpath=server.mappath(drvpath) setd=fso.getfolder(drvpath) size=d.size
showsize=size&”Byte” ifsize1024Then size=(Size/1024) showsize=size&”KB”
endIf ifsize1024Then size=(size/1024) showsize=formatnumber(size,2)&”MB”
endIf ifsize1024Then size=(size/1024) showsize=formatnumber(size,2)&”GB”
endIf response.write”fontface=verdana”&showsize&”/font” EndSub % %
SubRestoreData() % divalign=center divalign=center br/…

发表评论

电子邮件地址不会被公开。 必填项已用*标注

相关文章