当前位置: 首页 > 图文教程 > 网络编程 > 编程10000问 > 如何处理超时事件?

编程10000问
如何让用户再次访问我的网站时不需再提交相关信息?
如何用Cookie进行登录验证?
如何决定是否将登录内容保存到Cookie里?
如何在ASP中恰当地运用Cookies?
如何在Flash中处理Cookies?
怎样使用Cookie跟踪来访者?
可以在线创建文件夹吗?
如何一行行地读取文件?
如何读取文本文件的内容?
如何显示一个文本文件?
如何做一个文本书写器?
如何创建Word文件?
如何遍历目录及目录下的文件?
如何用表单在线建立目录?
如何创建一个PDF文件?
如何通过表单创建一个Word?
如何对文件进行操作?
如何对一个文件夹进行创建和删除?
如何获取文件的名称和扩展名?
如何获知并显示文件的大小?

编程10000问 中的 如何处理超时事件?


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-10   浏览: 22 ::
收藏到网摘: n/a

如何处理超时事件?


1
IIS为一个死循的执行过程设定执行时间(缺省为90秒)超时事件:
<%response.buffer=true%>
<body><html>
<%
DO
counter=counter+1
response.write counter & "<br>"
response.flush
LOOP
%>
</body></html>

2、自定义时间。用程序设定超时事件的时间段:
<%
response.buffer=true
server.scripttimeout=20
%>
<body><html>
<%
DO
counter=counter+1
response.write counter & "<br>"
response.flush
LOOP
%>
</body></html>

3、干涉超时时间段。捕获超时:
<%@ trANSACTION=Required%>
<%
response.buffer=true
server.scripttimeout=20
%>
<html><body>
</body>
<%
DO
counter=counter+1
response.write counter & "<br>"
LOOP
response.flush
response.write "
脚本运行完啦!"
%>
</html>
<%
Sub OnTransactionAbort()
response.clear
Response.Write "
,脚本运行超时了!"
end sub
%>
4
、绕过超时事件:
<%@ trANSACTION=Required%>
<%
response.buffer=true
server.scripttimeout=40
%>
<html><body>
</body>
<%
DO UNTIL counter=400
counter=counter+1
response.write counter & "<br>"
LOOP
response.flush
response.write "
脚本运行完啦!"
%>
</html>
<%
Sub OnTransactionAbort()
response.clear
Response.Write "
,脚本运行超时了!"
end sub
%>