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

📄 admin_data2.asp

📁 一套基于asp的网络办公系统!功能类似于oa
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>

<%
if Session("Urule")<>"a" then
response.redirect "error.asp?id=admin"
end if

%>

<!--#include file="data.asp"-->
<!-- #include file="check.asp" -->

<title>备份数据库</title>
<link rel="stylesheet" type="text/css" href="oa1.css">

<BODY bgcolor="#DFEBFF" alink="#333333" vlink="#333333" link="#333333" topmargin="20">
<table border="0"  cellspacing="1" cellpadding="5" height="1" align=center width="95%" class="tableBorder">
  				<tr>
  					<th height=25 >
  					&nbsp;&nbsp;<B>备份<span lang="zh-cn">红金羚</span>数据</B>( 需要FSO支持, )
  					</th>
  				</tr>
  				<form method="post" action="admin_data2.asp">
  				<tr>
  					<td height=100 class="forumrow">
  						&nbsp;&nbsp;
						当前数据库路径(相对路径):<input type=text size=15 name=DBpath value="<%=db%>"><BR>&nbsp;&nbsp;
						备份数据库目录(相对路径):<input type=text size=15 name=bkfolder value=Databackup>&nbsp;如目录不存在,程序将自动创建<BR>&nbsp;&nbsp;
						备份数据库名称(填写名称):<input type=text size=15 name=bkDBname value=redboy.mdb>&nbsp;如备份目录有该文件,将覆盖,如没有,将自动创建<BR>
						&nbsp;&nbsp;<input type=submit value="数据备份"><br>
  						-----------------<br>
  						&nbsp;&nbsp;在上面填写本程序的数据库路径全名,本程序的默认数据库文件为<font color="#FF0000">redboy\redboy.mdb</font>,<B>请一定不能用默认名称命名备份数据库</B><br>
  						&nbsp;&nbsp;您可以用这个功能来备份您的法规数据,以保证您的数据安全!<br>
  						&nbsp;&nbsp;注意:所有路径都是相对与程序空间根目录的相对路径				</font>
  					</td>
  				</tr>	
  				</form>
  			</table>
  			</BODY>
<%
		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 "备份数据库成功,您备份的数据库路径为" &bkfolder& "\"& bkdbname
		Else
			response.write "找不到您所需要备份的文件。"
		End if

'------------------检查某一目录是否存在-------------------
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)
	dim f
    Set fso1 = CreateObject("Scripting.FileSystemObject")
        Set f = fso1.CreateFolder(foldername)
        MakeNewsDir = True
    Set fso1 = nothing
End Function


%>

⌨️ 快捷键说明

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