日期:2012-12-15  浏览次数:20887 次

原作者:东子

在你要再线人数显示的地方的页首添加
<%@ Language=VBScript %>
<% Option Explicit %>
在你要再线人数显示的地方
<!-- #include file="show_count.asp" -->
详细列表
<!-- #include file="show_users.asp" -->


这里是show_users.asp的原程序
<%
If rstActiveUsers.RecordCount > 0 Then
    rstActiveUsers.MoveFirst

    Response.Write "<table border=""1"">" & vbCrLf

    Response.Write " <thead>" & vbCrLf
    Response.Write "  <th>Session Id</td>" & vbCrLf
    Response.Write "  <th>IP Address</th>" & vbCrLf
    Response.Write "  <th>User Agent</th>" & vbCrLf
    Response.Write "  <th>Session Start Time</th>" & vbCrLf
    Response.Write " </thead>" & vbCrLf

    Do While Not rstActiveUsers.EOF

        Response.Write " <tr>" & vbCrLf
        Response.Write "  <td>" & rstActiveUsers.Fields("id").Value & "</td>" & vbCrLf
        Response.Write "  <td>" & rstActiveUsers.Fields("ip").Value & "</td>" & vbCrLf
        Response.Write "  <td>" & rstActiveUsers.Fields("browser").Value & "</td>" & vbCrLf
        Response.Write "  <td>" & rstActiveUsers.Fields("started").Value & "</td>" & vbCrLf
        Response.Write " </tr>" & vbCrLf
        
        rstActiveUsers.MoveNext
    Loop
    Response.Write "</table>" & vbCrLf

End If
%>

这里是show_count.asp的原程序
<b><font color="#CC0000"><%= rstActiveUsers.RecordCount %></font> 在线用户</b>