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

📄 backup.asp

📁 聊天室源码呵呵你好用~~~~~~2.0版本
💻 ASP
字号:
<%@ LANGUAGE=VBScript%>
<%Server.ScriptTimeout=600
Response.Expires=0
if Session("a_c_user_name")="" then
 Response.write "<b>[操作失败]</b><p>您尚未登录(或已经超时退出),不能进行此操作!"
 Response.end
end if
if Session("a_c_user_level")<10 then
 Response.Write "<b>[操作失败]</b><p>您没有备份/还原的权限!"
 Response.End
end if
id=Trim(Request.QueryString("id"))
if id>20 then id=20
if id<1 then id=1
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
sj = s & ":" & f & ":" & m
sj2= n & "-" & y & "-" & r & " " & sj
Set fs=CreateObject("Scripting.FileSystemObject")
ud=Server.Mappath("userdata_v150.asp")
bd=Server.Mappath("bak/"&id&".asp")
fs.CopyFile ud, bd, True
logfile=server.mappath("bak/backuplog.asp")
Set thisfile=fs.OpenTextFile(logfile,1,False)
dim input(20)
counter=0
do while not thisfile.AtEndOfStream
 thisline=thisfile.readline
 input(counter)=thisline
 counter = counter + 1
loop
thisfile.Close
Set outfile=fs.CreateTextFile(logfile)
for i=0 to 20
 if i=int(id) then
  outfile.WriteLine sj2
 else
  outfile.WriteLine input(i)
 end if
next
outfile.Close
Response.Write "<br><br><br><p align=center>已经将数据文件备份到位置 <font color=#FF0000>" & id & "</font> 中</p>"
Response.Write "<p align=center>备份时间:<font color=#FF0000>" & sj2 & "</font></p>"
Response.Write "<p align=center><a href='javascript:history.go(-1)'>返回</a></p>"%>

⌨️ 快捷键说明

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