如何處理超時(shí)事件?
如何處理超時(shí)事件?
1、IIS為一個(gè)死循的執(zhí)行過程設(shè)定執(zhí)行時(shí)間(缺省為90秒)超時(shí)事件:
<%response.buffer=true%>
<body><html>
<%
DO
counter=counter+1
response.write counter & "<br>"
response.flush
LOOP
%>
</body></html>
2、自定義時(shí)間。用程序設(shè)定超時(shí)事件的時(shí)間段:
<%
response.buffer=true
server.scripttimeout=20
%>
<body><html>
<%
DO
counter=counter+1
response.write counter & "<br>"
response.flush
LOOP
%>
</body></html>
3、干涉超時(shí)時(shí)間段。捕獲超時(shí):
<%@ trANSACTION=Required%>
<%
response.buffer=true
server.scripttimeout=20
%>
<html><body>
</body>
<%
DO
counter=counter+1
response.write counter & "<br>"
LOOP
response.flush
response.write "腳本運(yùn)行完啦!"
%>
</html>
<%
Sub OnTransactionAbort()
response.clear
Response.Write "噢,腳本運(yùn)行超時(shí)了!"
end sub
%>
4、繞過超時(shí)事件:
<%@ 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 "腳本運(yùn)行完啦!"
%>
</html>
<%
Sub OnTransactionAbort()
response.clear
Response.Write "噢,腳本運(yùn)行超時(shí)了!"
end sub
%>
相關(guān)文章
統(tǒng)計(jì)在線人數(shù)是實(shí)時(shí)的嗎?
統(tǒng)計(jì)在線人數(shù)是實(shí)時(shí)的嗎?...2006-11-11如何用數(shù)據(jù)庫制作一個(gè)多用戶版的計(jì)數(shù)器?
如何用數(shù)據(jù)庫制作一個(gè)多用戶版的計(jì)數(shù)器?...2006-11-11如何防止計(jì)數(shù)器刷新計(jì)數(shù)?
如何防止計(jì)數(shù)器刷新計(jì)數(shù)?...2006-11-11