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

📄 backup.asp

📁 本系统无论是现在还是将来的升级的版本均免费。学生综合测评分也叫综合分或者纪律分
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="img/Style.css" rel="stylesheet" type="text/css" />
</head>
<!-- #include file="const.asp" -->
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<body>
<table width="76%" border="0" align="center" cellpadding="6" cellspacing="0" bordercolorlight="#ECEEE4" bordercolordark="#CCCABC" class="atable1">
    <tr> 
      <td colspan="2" align="center" height="30" background="image/tablebg.gif">备份系统数据</td>
    </tr>
    <tr valign="middle"> 
      <td>
	   <%
	if request("action")="Backup" then
	call backupdata()
	else
%>
      <form method="post" action="backup.asp">
	   备份数据( 需要FSO支持,FSO相关帮助请看微软网站 ) 
       <br /> 当前数据库路径(相对路径): 
        <span class="red"><%=dbph%></span>
        <br />
         备份数据库目录(相对路径): 
        <span class="red">Databackup</span>
        如目录不存在,程序将自动创建<br />
         备份数据库名称(填写名称): 
        <input type="text" size="20" name="bkDBname" value="systembackup.asa" class="atable1">
        如备份目录有该文件,将覆盖,如没有,将自动创建<br />
         
        <input type="submit" value="确定备份" class="atable1">
        <br />
        -----------------------------------------------------------------------------------------<br />
        在上面填写本程序的数据库路径全名,本程序的默认数据库文件为<span class="red">systembackup.asa(实名:systembackup.mdb)</span> <br />
        您可以用这个功能来备份您的法规数据,以保证您的数据安全!<br />
        注意:所有路径都是相对与程序空间根目录的相对路径 </font> 
		<input type="hidden" name="action" value="Backup">
  </form>
<%end if%>
<%

sub backupdata()
		Dbpath=dbph
		Dbpath=server.mappath(Dbpath)
		
		bkfolder="Databackup"
		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 "备份数据库成功,您备份的数据库路径为<span class=""red"">" &bkfolder& "\"& bkdbname&"</span>"
			response.write "<br /><br /><input type=button value=' 返 回 ' class='atable1' onclick=javascript:location.href=""backup.asp"">"
		Else
			errmsg = "<li>找不到您所需要备份的文件。"
			Response.Write(errmsg)
			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
'-------------根据指定名称生成目录---------
Function MakeNewsDir(foldername)
    Set fso1 = CreateObject("Scripting.FileSystemObject")
        Set f = fso1.CreateFolder(foldername)
        MakeNewsDir = True
    Set fso1 = nothing
End Function
%>
	  </td>
    </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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