1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<% Dim RefreshIntervalTime RefreshIntervalTime = 3 '防止刷新的时间秒数,0表示不防止 If Not IsEmpty(Session("visit")) And IsNumeric(Session("visit")) And Int(RefreshIntervalTime) > 0 Then If (Timer() - Int(Session("visit"))) * 1000 < RefreshIntervalTime * 1000 Then Response.Write ("<meta http-equiv=""refresh"" content="""& RefreshIntervalTime &""" />") Response.Write("呵呵,老朋友,您点得实在太快了,我会很累的啊,为了能更好的为您服务,请不要在3秒内连续点击*^_^*。谢谢您的关心!正在打开页面,请稍候……") Session("visit") = Timer() Response.End End If End If Session("visit") = Timer() %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Asp 防止网页频繁刷新一法</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link rel="stylesheet" type="text/css" href="style.css"> <style type="text/css"> </style> </head> <body style="background-color:#666666;font-size:36pt;font-family:黑体;color:#FFFFFF;"> 页面内容,页面内容 <%=timer()%> </body> </html> |