当前位置:首页 > ASP

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

canca16年前 (2010-02-27)ASP527
<%@ 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…

ASP中如何实现类似Sleep()的时间延迟?

ASP中有时候也需要SLEEP()函数,即等待一段时间再继续执行跟着的代码。如何实现呢?我搜索了很久,得到很少解决的办法。下面是一些折中的做法: 1. sub MySleep(mySleepTime)dim myTimemyTime = nowWhile DateDiff("s",myTime,no…

带进度条的ASP无组件断点续传下载[ServerXMLHTTP]

  <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><%Option Explicit%> <%'==================================''带进度条的ASP无组件断点续传下载''=========…

在ASP中操作HTTP报头方法分析

我们已经在几处见到ASP如何创建或修改在响应页面请示时被发送到客户的HTTP报头。在Response对象中有几个属性和方法可帮助我们做到一点。下面是一些报头方法: · 控制缓存和有效期。 · 创建状态和定制的HTTP报头。 ...…

发表评论

访客

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