?? admin_backupdata.asp
字號(hào):
<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Redirect "login.asp"
end if
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您沒(méi)有此項(xiàng)目管理權(quán)限!</b></font></div>"
response.End
end if
if qx20<>1 then
response.Write "<div align=center><font size=80 color=red><b>您沒(méi)有此項(xiàng)目管理權(quán)限!</b></font></div>"
response.End
end if
if request("action")="Backup" then
call backupdata()
else
%>
<!--#include file="../webconfig.asp"-->
<html>
<head>
<title>管理中心</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK REL="stylesheet" HREF="../css.css" TYPE="text/css">
<style type="text/css">
<!--
.style3 {
color: #000000;
font-weight: bold;
}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/right_top2.gif">
<tr>
<td width="1%"> </td>
<td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="30%" style="font-size:14px;color:#ffffff"> <span class="style3">備份數(shù)據(jù)</span></td>
<td width="70%" align="right"> </td>
</tr>
</table></td>
</tr>
</table>
<br>
<br><br>
<form method="post" action="admin_BackupData.asp">
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">
<tr bgcolor="#C7D3E6">
<td colspan="2"> <B>備份數(shù)據(jù)</B>( 需要FSO支持,F(xiàn)SO相關(guān)幫助請(qǐng)看微軟網(wǎng)站 ) </td>
</tr>
<tr bgcolor="#F0F3F8">
<td><div align="center">當(dāng)前數(shù)據(jù)庫(kù)路徑(相對(duì)路徑):</div></td>
<td><input type=text size=20 name=DBpath value=<%=db%> class="wenbenkuang"></td>
</tr>
<tr bgcolor="#F0F3F8">
<td><div align="center">備份數(shù)據(jù)庫(kù)目錄(相對(duì)路徑):</div></td>
<td><input type=text size=20 name=bkfolder value="../databackup" class="wenbenkuang">
如目錄不存在,程序?qū)⒆詣?dòng)創(chuàng)建</td>
</tr>
<tr bgcolor="#F0F3F8">
<td><div align="center">備份數(shù)據(jù)庫(kù)名稱(填寫名稱):</div></td>
<td><input type=text size=20 name=bkDBname value="shop.mdb" class="wenbenkuang">
如備份目錄有該文件,將覆蓋,如沒(méi)有,將自動(dòng)創(chuàng)建</td>
</tr>
<tr bgcolor="#F0F3F8">
<td colspan="2"><div align="center">
<input name="submit" type=submit class="go-wenbenkuang" value="確定備份">
</div></td>
</tr>
<tr>
<td colspan="2"> 在上面填寫本程序的數(shù)據(jù)庫(kù)路徑全名,本程序的默認(rèn)數(shù)據(jù)庫(kù)文件為shop.mdb<br>
您可以用這個(gè)功能來(lái)備份您的法規(guī)數(shù)據(jù),以保證您的數(shù)據(jù)安全!<br>
注意:所有路徑都是相對(duì)與程序空間Data目錄的相對(duì)路徑
<input type="hidden" name="action" value="Backup"></td>
</tr>
</table>
<br>
</form>
<%end if%>
<%
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 "<SCRIPT LANGUAGE=JavaScript>alert (' 成功備份數(shù)據(jù)!');window.location.href='admin_backupdata.asp';</script>"
response.end
Else
response.write "<SCRIPT LANGUAGE=JavaScript>alert (' 備份數(shù)據(jù)庫(kù)失敗,您要備份的數(shù)據(jù)庫(kù)不存在!');window.location.href='admin_backupdata.asp';</script>"
response.end
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
'-------------根據(jù)指定名稱生成目錄---------
Function MakeNewsDir(foldername)
Set fso1 = CreateObject("Scripting.FileSystemObject")
Set f = fso1.CreateFolder(foldername)
MakeNewsDir = True
Set fso1 = nothing
End Function
%>
<!--#include file="copyright.asp"-->
</body></html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -