Sub PreventRefresh()
Dim RefreshTime,isRefresh
RefreshTime = 10 ’防止刷新時間,單位(秒)
isRefresh = 1 ’是否使用防刷新功能,0=否,1=是
If isRefresh = 1 Then
If (Not IsEmpty(Session("RefreshTime"))) And RefreshTime > 0 Then
If DateDiff("s", Session("RefreshTime"), Now()) < RefreshTime Then
Response.Write "<META http-equiv=Content-Type content=text/html;
chaRset=gb2312><meta HTTP-EQUIV=REFRESH CONTENT="&RefreshTime&"><br>
本頁面起用了防刷新機制,請不要在"&RefreshTime&"秒內連續刷新本頁面
<BR>正在打開頁面,請稍後……"
Response.End
Else
Session("RefreshTime") = Now()
End If
Else
Session("RefreshTime") = Now()
End If
End If
End Sub