?? manage_backup.asp
字號(hào):
<!--#include file="admin.asp"-->
<!--#include file="conn.asp"-->
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="150" align="center" valign="top"> <table width="150" height="100%" border="0" cellpadding="0" cellspacing="0" class="HeaderTdStyle">
<tr>
<td align="center" valign="top"><table width="100%" height="24" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">系統(tǒng)管理</td>
</tr>
</table>
<table width="100%" height="90%" border="0" cellpadding="0" cellspacing="0" class="MenuBg">
<tr>
<td align="center" valign="top"><br> <table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="16%"><img src="../Img/Left_1.gif" width="28" height="11"></td>
<td width="84%" height="20"><font color="#FFFF00">系統(tǒng)管理</font></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="Manage_Admin.asp"><font color="#FFFF00">管理員管理</font></a></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="Manage_backup.asp"><font color="#FFFF00">數(shù)據(jù)庫(kù)備份</font></a></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="Manage.asp"><font color="#FFFF00">系統(tǒng)幫助</font></a></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="UploadFileManage.asp"><font color="#FFFF00">上傳文件管理</font></a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td align="center" valign="top">
<br>
<strong><br>
</strong>
<table width="550" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">
<div align="center"><strong>備份數(shù)據(jù)庫(kù)</strong></div><%
if request("action")="Backup" then
call backupdata()
else
%></td>
</tr>
<tr>
<form method="post" action="Manage_backup.asp?action=Backup">
<td><br>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td height="25"><strong>備份商城數(shù)據(jù)文件</strong>[需要FSO權(quán)限]</td>
</tr>
<tr>
<td height="22"> 當(dāng)前數(shù)據(jù)庫(kù)路徑</td>
</tr>
<tr>
<td height="22"><input type=text size=50 name=DBpath value="<%=db%>"></td>
</tr>
<tr>
<td height="22"> 備份數(shù)據(jù)庫(kù)目錄[如目錄不存在,程序?qū)⒆詣?dòng)創(chuàng)建]</td>
</tr>
<tr>
<td height="22"><input type=text size=50 name=bkfolder value=Databackup></td>
</tr>
<tr>
<td height="22">備份數(shù)據(jù)庫(kù)名稱[如備份目錄有該文件,將覆蓋,如沒(méi)有,將自動(dòng)創(chuàng)建]</td>
</tr>
<tr>
<td height="22"><input type=text size=30 name=bkDBname value=DataShop.mdb></td>
</tr>
<tr>
<td height="22"><div align="center">
<input type=submit value="確定">
</div></td>
</tr>
<tr>
<td height="22"><br>
<br>
本程序的默認(rèn)數(shù)據(jù)庫(kù)文件為<%=db%><br>
您可以用這個(gè)功能來(lái)備份您的法規(guī)數(shù)據(jù),以保證您的數(shù)據(jù)安全!<br>
注意:所有路徑都是相對(duì)與程序空間根目錄的相對(duì)路徑</td>
</tr>
<tr>
<td height="22"> </td>
</tr>
</table></td>
</form>
</tr>
</table>
<%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 "備份數(shù)據(jù)庫(kù)成功,您備份的數(shù)據(jù)庫(kù)路徑為" &bkfolder& "\"& bkdbname
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
'-------------根據(jù)指定名稱生成目錄---------
Function MakeNewsDir(foldername)
Set fso1 = CreateObject("Scripting.FileSystemObject")
Set f = fso1.CreateFolder(foldername)
MakeNewsDir = True
Set fso1 = nothing
End Function
%></td>
</tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -