Asp 防止网页频繁刷新一法

来源:无忧视窗 时间:2008-04-07 13:03:00 

下面示例代码是防止用网页刷新过快,如果多个页面使用,最好将<%...%>代码存为一个asp文件,在需要的页面最前面include file使用。

<%
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 ("刷新过快,请稍候")
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 防止网页频繁刷新一法 - 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;">
asp之家欢迎您!</body>
</html>
标签:刷新,asp
0
投稿

猜你喜欢

  • asp如何阻止别人非法链接你网站的图片?

    2010-07-11 21:01:00
  • 斐波那契数列的递归算法优化

    2010-01-23 11:37:00
  • IA学习笔记04:标签系统

    2009-09-22 14:40:00
  • 2010怎么就宅了——我们是设计星球的阿凡达

    2010-03-09 13:26:00
  • 建立合理的索引提高SQL Server的性能

    2009-01-23 14:44:00
  • 设计模式学习笔记之 - 简单工厂模式

    2009-03-11 13:38:00
  • JS获取对象代码总结

    2011-03-07 16:14:00
  • 纯CSS3透明水晶盒

    2011-08-24 20:20:06
  • 关于MySQL编码问题的经验总结

    2007-08-23 16:10:00
  • oracle应用程序实现打包 的方法

    2009-03-02 10:32:00
  • php链式操作mysql数据库(封装类带使用示例)

    2023-05-25 02:58:22
  • 三大措施设置数据库安全 保障网站安全运营

    2008-11-28 14:41:00
  • 如何才能保护好我们的SQL Server数据库

    2009-01-08 13:37:00
  • sql查询点滴记录

    2012-01-05 19:07:49
  • 匿名函数的写法

    2010-01-06 13:32:00
  • 利用Google Ajax Library API加速常用js类库的载入

    2008-06-17 17:44:00
  • 实现asp长文章自动分页插件

    2011-02-26 13:51:00
  • 如何优化JavaScript脚本的性能

    2008-02-19 21:47:00
  • ASP平台如何打造金牌英文网站

    2008-04-10 08:47:00
  • asp如何编写一个DNS LOOKUP程序?

    2009-11-07 18:47:00
  • asp之家 网络编程 m.aspxhome.com