统计站点Application和Session个数

<%
Application("aaa") = "木子屋"
Application("bbb") = Array(1,2,3)
Session("aaa") = "www.mzwu.com"
Set Session("bbb") = Server.CreateObject("ADODB.RecordSet")

'Application统计
Response.Write("Application个数:" & Application.Contents.Count & "<br/>")
For Each apps In Application.Contents
    If IsObject(Application.Contents(apps)) then
        Response.Write("[对象]" & "<br/>")
    ElseIf IsArray(Application.Contents(apps)) then
        Response.Write("[数组]" & "<br/>")
    Else
        Response.Write(apps & ":" & cHtml(Application.Contents(apps)) & "<br/>")
    End If
Next

Response.Write("<br/><br/>")

'Session统计
Response.Write("Session个数:" & Session.Contents.Count & "<br/>")
For Each sens In Session.Contents
    If IsObject(Session.Contents(sens)) then
        Response.Write("[对象]" & "<br/>")
    ElseIf IsArray(Session.Contents(sens)) then
        Response.Write("[数组]" & "<br/>")
    Else
        Response.Write(sens & ":" & cHtml(Session.Contents(sens)) & "<br/>")
    End If
Next


Function cHtml(iText)
  cHtml = iText
  cHtml = Server.HTMLEncode(cHtml)
  cHtml = Replace(cHtml,chr(10),"<br>")
End Function
%>


评论: 0 | 引用: 0 | 查看次数: 4196
发表评论
登录后再发表评论!