木子屋 Dnawo's BLOG

统计站点Application和Session个数

👤 dnawo 📅 2008-01-17 👁 4789 👍 0 💬 0 🔄 阿江ASP探针
<%
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)

暂无评论。

计算题
评论需审核通过后显示
← 上一篇 Dvbbs8.1整合后无法同步登录解决方法 下一篇 → ASP也支持With语句