<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<%Call Head()%>

<%id=usb(request("id"))
if id="" then id="99999999999999"
fid=usb(request("fid"))
ffss=usb(request("ffss"))
cz=usb(request("cz"))
xb=usb(request("xb"))
Call saycarda("备份数据")
if cz=""&zqfjsf&"" then
if xb=1 then
Dbpath=server.mappath(""&saytkcomshuju&"")
backpath=server.mappath(""&ffss&"")
if dbpath="" then
response.write "请输入您要您要备份的数据库" 
else

end if

Set Fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(dbpath) then       
fso.copyfile Dbpath,Backpath
response.write "数据备份成功！"&ffss&""
else
response.write "数据库地址不存在<a href=""sjgm.asp?saytk="&saytk&"&amp;sid="&sid&""">进入重命名</a>"
end if
else
Set fs = Server.CreateObject("Scripting.FileSystemObject")
SFile = Server.MapPath(""&saytkcomshuju&"")
TFile = Server.MapPath("/shujuku/bfsj/"&ffss&"")
on Error Resume Next
fs.CopyFile SFile,TFile
If Err.Number = 53 Then
 Response.Write SFile & "数据不存在！<a href=""sjgm.asp?saytk="&saytk&"&amp;sid="&sid&""">进入重命名</a>"
Elseif Err.Number = 70 Then
 Response.Write TFile & "文件属性为只读！"
Elseif Err.Number <> 0 Then
 Response.Write "未知错误，错误编码：" & Err.Number
Else
 Response.Write "成功备份数据！<br/>"
End If
end if

 Response.Write "<br/>"
%>
<%end if%>
<%if cz<>"" and cz<>""&zqfjsf&"" then%>
对不起，安全码错误<br/>
<%end if
response.Write"当旧版不能用请切换新版如果新版也错误请检查数据库名如果在错误请联系管理<br/>"
if xb=1 then
response.Write"新版|<a href=""bfsj.asp?sid="&sid&"&amp;saytk="&saytk&"&amp;xb=0"">旧版</a><br/>"
else
response.Write"旧版|<a href=""bfsj.asp?sid="&sid&"&amp;saytk="&saytk&"&amp;xb=1"">新版</a><br/>"
end if
set fso=server.createobject("scripting.filesystemobject") 
set fl=fso.getfolder(""&server.mappath("/shujuku/bfsj/")&"") 
on error resume next 
response.write "【已备份的数据库】" 
for each fn in fl.files 
if fn.name="" then
response.Write"<br/>还没有查找到数据库<br/>"
else
response.write "<br/>"&fn.name 

end if
next 
response.Write"<br/>"
if saytk>1 then
call xlanlj("bfsj.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;xb="&xb&"")%>
安全码<input name='cz' value=''/>*
<br/>
<%if xb=1 then%>
备份名<input name='ffss' value='/shujuku/bfsj/<%=Year(Now)%><%=Month(Now)%><%=Day(Now)%>.mdb'/>*<br/>
<%else%>
备份名<input name='ffss' value='<%=Year(Now)%><%=Month(Now)%><%=Day(Now)%>.mdb'/>*<br/>
<%end if
response.write "<input type=""hidden"" name=""idp"" value=""$(idp)""/>"
call xlanlj1("确定备份")
else%>
安全码<input name='iidd<%=minute(now)%><%=second(now)%>' value=''/>*<br/>
<%if xb=1 then%>
备份名<input name='dq<%=minute(now)%><%=second(now)%>' value='/shujuku/bfsj/<%=Year(Now)%><%=Month(Now)%><%=Day(Now)%>.mdb'/>*<br/>
<%else%>
备份名<input name='dq<%=minute(now)%><%=second(now)%>' value='<%=Year(Now)%><%=Month(Now)%><%=Day(Now)%>.mdb'/>*<br/>
<%end if%>
<anchor>确定备份<go href='bfsj.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>&amp;xb=<%=xb%>' method='post' accept-charset='utf-8'>
<postfield name='idp' value='$(idp)'/>
<postfield name='cz' value='$(iidd<%=minute(now)%><%=second(now)%>)'/>
<postfield name='ffss' value='$(dq<%=minute(now)%><%=second(now)%>)'/>
</go></anchor>
<%end if

%>

<br/>-------<br/>
<a href="index.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>">[后台管理]</a><br/>
注：定期备份数据有助于出现问题时的处理<br/>
本备份系统由龙门网独立修改制作<br/>
技术支持QQ:565659541<br/>
<%Call headsay()%>
