繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP基础 >> 代码段1---列出你的所有Session变量

代码段1---列出你的所有Session变量

2006-07-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:
关键字:变量 Session 代码

<%@ Language=VBScript %>

<% Option Explicit %>

<%

Response.Write "在你的程序中一共使用了 " & Session.Contents.Count & _

" 个Session变量

"

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) & "
"

Next

Else

'如果不是数组,那么直接显示

Response.Write strName & " - " & Session.Contents(strName) & "
"

End If

Next

%>

责任编辑:admin
相关文章