<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<!--#include file=cookies1.asp-->
<head>
<title>管理页面</title>
<meta NAME=GENERATOR Content="Microsoft FrontPage 6.0" FrontPage 3.0"" CHARSET=GB2312 Microsoft>
<link href="inc_style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
<!--
body {
	background-color: #E7EEF5;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>
<BODY>
<p align="center">

<div align="center">
  <table width="68%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4" style="font-size:12px; letter-spacing:1px;">

<tr bgcolor="#B6EBC4">
<td width="67%" valign=top bgcolor="#C5D5E4"><font>
<%
 dim Dbpath,bkfolder,bkdbname,Fso,fso1,f
	if request("action")="Backup" then
	call backupdata()
	else
%>
  <table width="68%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4" style="font-size:12px; letter-spacing:1px;">

<tr bgcolor="#B6EBC4">
<td height=25 bgcolor="#D8E2EF" >
<p align="center">
<font style="font-size: 12px">
&nbsp;&nbsp;<B>备份网站数据</B>( 需要FSO支持)</font><span style="font-size: 12px">
</span></td>    
</tr>    
<form method="POST" action="beifendata.asp?action=Backup">    
<tr >    
<td width="100%" height=100 bgcolor="#EDF2F8" >  
<p align="center">  
<span style="font-size: 12px">当前数据库路径(相对路径)：<input type=text size=21 name=DBpath value="<%=db%>"><br>
备份数据库目录(相对路径)：<input type=text size=21 name=bkfolder value=../alldata/buk><br>
备份数据库名称(填写名称)：
<input type=text size=21 name=bkDBname value=jledata.mdb><BR>    
&nbsp;&nbsp;<br>
<input type=submit value=" 确 定 "></span></td>    
</tr>	    
</form>    
</table>    
<%end if%></font>    
</td>    
</tr>    
</table>    
    
</div>
    
    
<%    
    
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 "备份数据库成功"    
		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    
%>