服务器之家:专注于服务器技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|JAVA教程|ASP教程|

服务器之家 - 编程语言 - ASP教程 - 用Asp如何实现防止网页频繁刷新?

用Asp如何实现防止网页频繁刷新?

2019-10-29 14:55asp教程网 ASP教程

用Asp如何实现防止网页频繁刷新?

  1. <%  
  2.     dim RefreshIntervalTime  
  3.     RefreshIntervalTime = 3 '防止刷新的时间秒数,0表示不防止  
  4.     If Not IsEmpty(Session(“visit“)) and isnumeric(Session(“visit“)) and int(RefreshIntervalTime) > 0 Then  
  5.      if (timer()-int(Session(“visit“)))*1000 < RefreshIntervalTime * 1000 then  
  6.       Response.write (“<meta http-equiv=““refresh““ content=“““& RefreshIntervalTime &“““ />“)  
  7.       Response.write (“刷新过快,请稍候“)  
  8.       Session(“visit“) = timer()  
  9.       Response.end  
  10.      end if  
  11.     End If  
  12.     Session(“visit“) = timer()  
  13.     %><!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN“>  
  14.     <html>  
  15.     <head>  
  16.     <title>Asp如何防止网页频繁刷新-wwww.zhangpeng.com.cn</title>  
  17.     <meta http-equiv=“Content-Type“ content=“text/html; charset=gb2312“>  
  18.     <link rel=“stylesheet“ type=“text/css“ href=“style.css“>  
  19.     <style type=“text/css“>  
  20.     </style>  
  21.     </head>  
  22.     <body style=“background-color:#666666;font-size:36pt;font-family:黑体;color:#FFFFFF;“>  
  23.     Asp如何防止网页频繁刷新-www.zhangpeng.com.cn  
  24.     </body>  
  25.     </html> 

延伸 · 阅读

精彩推荐