<%
application.lock
if not isarray( application( "lastten" ) ) then
dim dummy( 10, 3 )
application( "lastten" ) = dummy
' 创建或者取得最近10个application数组.
end if
lastten = application( "lastten" )
application.unlock
if lastten( 9, 0 ) <> "" then
for i = 0 to 9
lastten( i, 0 ) = lastten( i + 1, 0 )
lastten( i, 1 ) = lastten( i + 1, 1 )
lastten( i, 2 ) = lastten( i + 1, 2 )
' 在数组里向下移动每位来访者.
next
end if
for i = 0 to 9
' 添加新数组.
if lastten( i, 0 ) = "" then
lastten( i, 0 ) = request.servervariables( "remote_addr" )
lastten( i, 1 ) = request.servervariables( "http_user_agent" )
lastten( i, 2 ) = now()
exit for
end if
next
application.lock
application( "lastten" ) = lastten
application.unlock
%>
<center>
<table bgcolor="#ccccc" cellspacing=0 cellpadding=3 border=1>
<tr bgcolor="lightyellow">
<td>来访者</td>
<td>ip地址</td>
<td>浏览器</td>
<td>访问时间</td>
' 显示最后10名来访者.
</tr>
<%
for i = 0 to 9
if lastten( i, 0 ) <> "" then
%>
<tr>
<td><small><%=i + 1%></small></td>
<td><small><%=lastten( i, 0 )%></small></td>
<td><small><%=lastten( i, 1 )%></small></td>
<td><small><%=lastten( i, 2 )%></small></td>
</tr>
<%
end if
next
%>
</table>
[1]
发表评论