減輕服務器負擔
-
Sub PreventRefresh()
Dim RefreshTimeisRefresh
RefreshTime =’防止刷新時間 單位(秒)
isRefresh =’是否使用防刷新功能 =否 =是
If isRefresh =Then
If (Not IsEmpty(Session("RefreshTime"))) And RefreshTime >Then
If DateDiff("s"Session("RefreshTime") Now()) < RefreshTime Then
ResponseWrite "<META http equiv=Content Type content=text/html;
chaRset=gb><meta HTTP EQUIV=REFRESH CONTENT="&RefreshTime&"><br>
本頁面起用了防刷新機制請不要在"&RefreshTime&"秒內連續刷新本頁面
<BR>正在打開頁面請稍後……"
ResponseEnd
Else
Session("RefreshTime") = Now()
End If
Else
Session("RefreshTime") = Now()
End If
End If
End Sub
From:http://tw.wingwit.com/Article/program/net/201311/14201.html