当前位置:首页 > ASP

ASP查看所有Application和Session变量的方法

canca16年前 (2010-02-27)ASP544
<%@ LANGUAGE="VBSCRIPT" %>
<%
'#####################################################
'Function:
'           List server Session variable &  Application  variable
'Author: Hardy He
'Date:   2003-3-12 23:30
'Memo: Be care for diffrent virtul path show diffrent Session
'#####################################################
%>
<table border="2" cellspacing="1" bordercolor="#800000" width="100%" id="AutoNumber1" bordercolorlight="#808080" bordercolordark="#FFFFFF" height="37" bgcolor="#D6D3CE">
<%
  Dim sessitem
   
 
  response.write "SessionID: " & Session.SessionID & "
"
  response.write "List of " & Session.Contents.Count & "   items in Session  contents collection: "
 
 
  intItem=1
  For Each sessitem in Session.Contents
    response.write "<tr>"
    If IsObject(Session.Contents(sessitem)) Then
         Response.Write  "<td>"+CStr(intItem) + "</td>"
           Response.Write  "<td>"+sessitem+ "</td>"
           Response.Write  "<td>"+"Session object"+ "</td>"
    Else
      If IsArray(Session.Contents(sessitem)) Then        
        Response.Write  "<td>"+CStr(intItem) + "</td>"
         Response.Write  "<td>"+"Array Object "+ "</td>" + "<td>"
                 
         For each objArray in Session.Contents(sessitem)
         Response.Write  "***;"
         Next
         Response.Write "</td>"
                 
      Else
             Response.Write  "<td>"+CStr(intItem) + "</td>"
        Response.Write  "<td>"+ sessitem + "</td>"
        Response.Write  "<td>"+ CStr(Session.Contents(sessitem)) + "</td>"        
      End If
    End If
    response.write "</tr>"
    intItem=intItem+1  
  Next
 
%>
</table>






<hr>
LIST Application




<hr>
<table border="2" cellspacing="1" bordercolor="#800000" width="100%" id="AutoNumber1" bordercolorlight="#808080" bordercolordark="#FFFFFF" height="37" bgcolor="#D6D3CE">
<%




   intItem=1
   For Each Key in Application.Contents




    Response.Write  "<tr>"
    If IsObject(Application.Contents(intItem)) Then
     
     Response.Write  "<td>"+CStr(intItem) + "</td>"
     Response.Write  "<td>"+CStr(Key) + "</td>"
     Response.Write  "<td>"+"Object" + "</td>"
     
    Else    
     Response.Write  "<td>"+CStr(intItem) + "</td>"
     Response.Write  "<td>"+CStr(Key) + "</td>"
     Response.Write  "<td>"+CStr(Application.Contents(intItem)) + "</td>"    
    End If
    intItem=intItem+1
    Response.Write  "</tr>"
   
  Next
 
 %>
</table>


你可以修改这个程序将所有Application清除

Session变量清除很简单:Session.Abound

扫描二维码推送至手机访问。

版权声明:本文由Ant.Master's Blog发布,如需转载请注明出处。

本文链接:https://iant.work/post/307.html

标签: ASP
分享给朋友:

“ASP查看所有Application和Session变量的方法” 的相关文章

如何提高ASP数据查询执行效率

1 明确查询的字段名称2 使用rs(0)比rs(“name”)更快3 使用记录集rs值前,将其赋值给变量4 [TEST] 现有10W条数据,Access数据库保存通过正常提取 | 通过存储过程提取| 使用GetRows()方法提取: 1 明确查询的字段名称 Select * from [data_t…

CCKiller v2.0 ASP版发布

CCKiller  v2.0 是CC攻击的杀手,能防CC攻击,DDOS攻击,防采集,适合于所有ASP网站!! 使用很简单,直接include进来就可以了。无需数据库支持。性能极优,效果极佳!!   让CPU回归自然的波浪线吧!!!   如需要,...…

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。