<% dim cls if session("admin")="" then Response.Redirect("index.asp?err=4") else if session("flag")<>"0" then cls = Instr(session("flag"), "tem") if cls <= 0 then %> <% end if end if end if %> 管理中心—友情链接管理
当前位置:网站管理中心--系统管理
数据库备份   
<%if request("back")="" then%>
<% if request("action")="Backup" then call backupdata() else %>
备份系统数据文件[需要FSO权限]
当前数据库路径
备份数据库目录[如目录不存在,程序将自动创建]
备份数据库名称[如备份目录有该文件,将覆盖,如没有,将自动创建]
本程序的默认数据库文件为<%=db%>
您可以用这个功能来备份您的法规数据,以保证您的数据安全!
注意:所有路径都是相对与程序空间根目录的相对路径
 
<%end if%> <% sub backupdata() Dbpath=request.form("Dbpath") Dbpath=server.mappath(Dbpath) bkfolder=request.form("bkfolder") bkdbname=request.form("bkdbname") Response.Write "
" If not IsObjInstalled("Scripting.FileSystemObject") Then Response.Write "你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能" Else Set Fso=server.createobject("scripting.filesystemobject") if fso.fileexists(dbpath) then If CheckDir(bkfolder) = true Then fso.copyfile dbpath,bkfolder& "\"& bkdbname else MakeNewsDir bkfolder fso.copyfile dbpath,bkfolder& "\"& bkdbname end if response.write "备份数据库成功,您备份的数据库路径为" &bkfolder& "\"& bkdbname Response.write "

点击返回
" Else response.write "找不到您所需要备份的文件。" End if end if Response.Write "
" end sub '------------------检查某一目录是否存在------------------- Function CheckDir(FolderPath) folderpath=Server.MapPath(".")&"\"&folderpath Set fso1 = CreateObject("Scripting.FileSystemObject") If fso1.FolderExists(FolderPath) then '存在 CheckDir = true Else '不存在 CheckDir = False End if Set fso1 = nothing End Function '-------------根据指定名称生成目录--------- Function MakeNewsDir(foldername) Set fso1 = CreateObject("Scripting.FileSystemObject") Set f = fso1.CreateFolder(foldername) MakeNewsDir = true Set fso1 = nothing End Function Function IsObjInstalled(strClassString) On Error Resume Next IsObjInstalled = False Err = 0 Dim xTestObj Set xTestObj = Server.CreateObject(strClassString) If 0 = Err Then IsObjInstalled = true Set xTestObj = Nothing Err = 0 End Function %>
<%else%>
<% if request("action")="Backup" then call backupdata2() else %>
还原系统数据文件[需要FSO权限]
备份数据库路径
还原数据库目录[如目录不存在,程序将自动创建]
还原数据库名称
本程序的默认数据库文件为<%=db%>
您可以用这个功能来还原您的法规数据,以保证您的数据安全!
注意:所有路径都是相对与程序空间根目录的相对路径
 
<%end if%> <% sub backupdata2() Dbpath=request.form("Dbpath") Dbpath=server.mappath(Dbpath) bkfolder=request.form("bkfolder") bkdbname=request.form("bkdbname") Response.Write "
" If not IsObjInstalled("Scripting.FileSystemObject") Then Response.Write "你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能" Else Set Fso=server.createobject("scripting.filesystemobject") if fso.fileexists(dbpath) then If CheckDir(bkfolder) = true Then fso.copyfile dbpath,bkfolder& "\"& bkdbname else MakeNewsDir bkfolder fso.copyfile dbpath,bkfolder& "\"& bkdbname end if response.write "还原数据库成功,您还原的数据库路径为" &bkfolder& "\"& bkdbname Response.write "

点击返回
" Else response.write "找不到还原文件。" End if end if Response.Write "
" end sub '------------------检查某一目录是否存在------------------- Function CheckDir(FolderPath) folderpath=Server.MapPath(".")&"\"&folderpath Set fso1 = CreateObject("Scripting.FileSystemObject") If fso1.FolderExists(FolderPath) then '存在 CheckDir = true Else '不存在 CheckDir = False End if Set fso1 = nothing End Function '-------------根据指定名称生成目录--------- Function MakeNewsDir(foldername) Set fso1 = CreateObject("Scripting.FileSystemObject") Set f = fso1.CreateFolder(foldername) MakeNewsDir = true Set fso1 = nothing End Function Function IsObjInstalled(strClassString) On Error Resume Next IsObjInstalled = False Err = 0 Dim xTestObj Set xTestObj = Server.CreateObject(strClassString) If 0 = Err Then IsObjInstalled = true Set xTestObj = Nothing Err = 0 End Function %>
<%end if%>