安大互联
财经热点 > Asp编程 > 代码段1--列出你的所有Session变量
代码段1--列出你的所有Session变量
浏览次数:【743】  发布日期:2009-8-13 12:09:22    文章分类:Asp编程   
专题:】 【
 
<%@ Language=VBScript %>
<% Option Explicit %>
<%
   Response.Write "在你的程序中一共使用了 " & Session.Contents.Count & _
             " 个Session变量<P>"
   Dim strName, iLoop
   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
%> 

手机扫码浏览该文章
 ● 相关资讯专题
  • 网络建设业务咨询

   TEl:13626712526