M 首页 > 技术文档 > ASP编程 > 文章查看

同类最新

相关文章


监测站点使用多少session和application的程序

打印文档 收藏本文  

以下是代码片段:

<%@ Language=VBScript %> 
  <% 
Option Explicit %> 
  
您的sessionID号是:<%=session.sessionid%><br
  <%  
  
Response.Write "在你的程序中一共使用了 " Session.Contents.Count 
  
" 个Session变量<P>" 
  
Dim strNameiLoop 
  
For Each strName in Session.Contents 
  ’’判断一个Session变量是否为数组 
  
If IsArray(Session(strName)) then 
  ’’如果是数组,那么罗列出所有的数组元素内容 
  
For iLoop LBound(Session(strName)) to UBound(Session(strName)) 
  
Response.Write strName "(" iLoop ") - " 
  Session
(strName)(iLoop) & "<BR>" 
  
Next 
  
Else 
  
’’如果不是数组,那么直接显示 
  Response
.Write strName " - " Session.Contents(strName) & "<BR>" 
  
End If 
  
Next 
   
  Response
.Write "在你的程序中一共使用了 " application.Contents.Count 
  
" 个application变量<P>"  
  
%>
  ------------------------------
  本站的检测结果:
  在你的程序中一共使用了 3 个Session变量
  在你的程序中一共使用了 4 个application变量


浏览: 来源:PhpMod.com 编辑:江江 发布时间:2005-08-26 07:14
Copyright © 2004 www.pclib.com All rights reserved.
Email:yehuo(at)163.com Oicq:35314270 桂ICP备05008870号