ASP禁止刷新当前页

减小字体 增大字体 作者:未知  来源:未知  发布时间:2005-8-23 10:38:05
方法1:
代码:
<%
Dim SplitReflashPage
Dim DoReflashPage
dim shuaxin_time
DoReflashPage=true
shuaxin_time=10
ReflashTime=Now()
if (not isnull(session("ReflashTime"))) and cint(shuaxin_time)>0 and DoReflashPage then
if DateDiff("s",session("ReflashTime"),Now())response.write "本页面起用了防刷新机制,请不要在"&shuaxin_time&"秒内连续刷新本页面
正在打开页面,请稍候……"
response.end
else
session("ReflashTime")=Now()
end if
elseif isnull(session("ReflashTime")) and cint(shuaxin_time)>0 and DoReflashPage then
Session("ReflashTime")=Now()
end if
randomize timer
regjm=int(rnd*8998)+1000  





方法2:
代码:
<%
Dim URL
If DateDiff("s",Request.Cookies("oesun")("vitistime"),Now())<2 Then
URL=Request.ServerVariables("Http_REFERER")
Response.Write("")
Response.Write("防刷新,两秒后自动跳转")
Response.End
End IF
Response.Cookies("oesun")("vitistime")=Now()
%>

[数据载入中...] [返回上一页] [打 印]