⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 backup.asp

📁 视频点播系统
💻 ASP
字号:
<!--#include file="security.asp"-->
<!--#include file="articleconn.asp"-->
<%if session("flag")>1 then
    response.write "<br><p align=center>您的操作权限不够!</p>"
    response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>备份数据库</title>
<style type=text/css>
body  { background:#799AE1; margin:0px; font:9pt 宋体; }
table  { border:0px; }
td  { font:normal 12px 宋体; }
img  { vertical-align:bottom; border:0px; }
a  { font:normal 12px 宋体; color:#000000; text-decoration:none; }
a:hover  { color:#428EFF;text-decoration:underline; }
.sec_menu  { border-left:1px solid white; border-right:1px solid white; border-bottom:1px solid white; overflow:hidden; background:#D6DFF7; }
.menu_title  { }
.menu_title span  { position:relative; top:2px; left:8px; color:#215DC6; font-weight:bold; }
.menu_title2  { }
.menu_title2 span  { position:relative; top:2px; left:8px; color:#428EFF; font-weight:bold; }
</style>
<body text="#000000" link="#000000" vlink="#000000" alink="#000000" bgcolor="#799AE1">
<%

dim bkfolder
dim bkdbname
dim fso
dim folderpath,fso1,f
call main()
conn.close
set conn=nothing
sub main()
%>
<p> </p>
<p> </p>
<center>
<%
if request("action")="Backup" then
call backupdata()
else
%>
<table border="1" cellpadding="6" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="80%">
<tr>
<td width="100%"  align="center" height="30" bordercolor="#333333"><b>
备份数据库</b></td>
</tr>
<tr>
<td width="100%">
<font color="#FF0000">注意:</font>备份数据需要FSO组件支持,FSO组件的相关帮助请看微软网站!<br>   所有路径都是相对与程序空间根目录的相对路径!</td>
 </tr>
<tr><form method="post" action="Backup.asp?action=Backup">
<td width="100%"><br>
   当前数据库路径:<input type=text size=24 name=DBpath value=".asp"> 
请正确添写您当前使用的数据库路径!<BR>   备份数据库目录:<input type=text size=24 name=bkfolder value=> 如果目录不存在,程序将自动创建!<BR>   备份数据库名称:<input type=text size=24 name=bkDBname value=> 如果备份目录有该文件,将覆盖,如果没有,程序将自动创建!<br><br>
            <input type=submit value="开始备份"></td>
</tr>
<tr>
<td width="100%">
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#FF0000">注:此功能谨慎使用,可能在
有些空间备份后,在本机上不能用ACCESS打开。</font></td>
</tr></form>
</table>
<%
end if
%>
  </center>
<%
end sub

sub backupdata()
Dbpath=request.form("Dbpath")
Dbpath=server.mappath(Dbpath)
bkfolder=request.form("bkfolder")
bkdbname=request.form("bkdbname")
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 "数据库备份完成,请进行其他操作!<br>建立使用 FTP 工具将数据库备份,以保证数据安全"
else
response.write "找不到您所需要备份的文件!"
end if
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
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -