asp网站后台运行自动产生dat文件和注销方法
rivatesubcsh()onerrorresumenextsetcreatfso=server.CreateObject("Scripting.FileSystemO...
rivate sub csh()
on error resume next
set creatfso=server.CreateObject("Scripting.FileSystemObject")
if err then
err.clear
webhistory "系统需要FSO支持,您的服务器不支持FSO ,系统不能正常运行!"
else
if not creatfso.fileexists(server.MapPath("/admin.dat")) then
set file = creatfso.opentextfile(server.MapPath("/admin.dat"), 2, TRUE)
file.write(now())
file.close
set file = nothing
set creatfso = nothing
else
set file = creatfso.opentextfile(server.MapPath("/admin.dat"), 1)
tstrtime=file.ReadLine
if tstrtime="" then
file.close
set file = nothing
creatfso.DeleteFile(server.MapPath("/admin.dat"))
else
dim ttime
ttime=abs(datediff(wrcyltimetype,tstrtime,now()))
if ttime>cint(wrcyltimenum) then
call overfile()
end if
file.close
set file = nothing
end if
end if
end if 展开
on error resume next
set creatfso=server.CreateObject("Scripting.FileSystemObject")
if err then
err.clear
webhistory "系统需要FSO支持,您的服务器不支持FSO ,系统不能正常运行!"
else
if not creatfso.fileexists(server.MapPath("/admin.dat")) then
set file = creatfso.opentextfile(server.MapPath("/admin.dat"), 2, TRUE)
file.write(now())
file.close
set file = nothing
set creatfso = nothing
else
set file = creatfso.opentextfile(server.MapPath("/admin.dat"), 1)
tstrtime=file.ReadLine
if tstrtime="" then
file.close
set file = nothing
creatfso.DeleteFile(server.MapPath("/admin.dat"))
else
dim ttime
ttime=abs(datediff(wrcyltimetype,tstrtime,now()))
if ttime>cint(wrcyltimenum) then
call overfile()
end if
file.close
set file = nothing
end if
end if
end if 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询