当前位置: 首页 > 图文教程 > 网络编程 > ASP > 页面延迟的两个简单方法

ASP
ASP进阶教程Ⅰ:循序渐进学留言薄
ASP进阶教程Ⅱ:一个简单的留言簿
ASP进阶教程Ⅲ:给留言簿润下色
ASP进阶教程Ⅵ:留言簿在线删除留言
ASP进阶教程Ⅴ:留言簿在线留言编辑(一)
ASP进阶教程Ⅴ:留言簿在线留言编辑(二)
ASP进阶教程Ⅳ:加入精彩留言
ASP进阶教程Ⅸ:留言查询功能(一)
ASP进阶教程Ⅸ:留言查询功能(二)
ASP进阶教程Ⅷ:数据库版本的留言簿
ASP基础讲座(上)
ASP系列讲座(一)关于 Active Server Pages
ASP系列讲座(二)ASP 的新功能
Asp用于分页的两个函数
ASP与Oracle连接时的TNS错误
小工具:统计有多少行JS代码和ASP代码,并有多少字节
一个xmlhttp读取xml的例子
ASP终极防范上传漏洞
防止网站内容被人小偷和采集的ASP代码
批量判断域名是否被注册程序代码

ASP 中的 页面延迟的两个简单方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 73 ::
收藏到网摘: n/a

  一、

<% Response.Buffer = True %>
<%
' Setup the variables necessary to accomplish the task
Dim TimerStart, TimerEnd, TimerNow, TimerWait
' How many seconds do you want them to wait...
TimerWait = 5
' Setup and start the timers
TimerNow = Timer
TimerStart = TimerNow
TimerEnd = TimerStart + TimerWait
' Keep it in a loop for the desired length of time
Do While (TimerNow < TimerEnd)
' Determine the current and elapsed time
TimerNow = Timer
If (TimerNow < TimerStart) Then
TimerNow = TimerNow + 86400
End If
Loop
' Okay times up, lets git em outa here
Response.Redirect "nextpage.html" %>

二、

<%
Sub TimeDelaySeconds(DelaySeconds)
SecCount = 0
Sec2 = 0
While SecCount < DelaySeconds + 1
Sec1 = Second(Time())
If Sec1 <> Sec2 Then
Sec2 = Second(Time())
SecCount = SecCount + 1
End If
Wend
End Sub
%>

' To change delay adjust here
<% TimeDelaySeconds(2) %>