shopa_sessionlist.asp

来自「ASP+SQL Server动态网站开发从基础到实践教程」· ASP 代码 · 共 25 行

ASP
25
字号
<%@ Language=VBScript %>
<% Option Explicit %>
<% 
   'How many session variables are there?
   Response.Write "There are " & Session.Contents.Count & _
             " Session variables<P>"

   Dim strName, iLoop
   'Use a For Each ... Next to loop through the entire collection
   For Each strName in Session.Contents
     'Is this session variable an array?
     If IsArray(Session(strName)) then
       'If it is an array, loop through each element one at a time
       Response.write "Array " & strName & "<br>" 
'       For iLoop = LBound(Session(strName)) to UBound(Session(strName))
'        Response.Write strName & "(" & iLoop & ") - " & _
'             Session(strName)(iLoop) & "<BR>"
'       Next
     Else
       'We aren't dealing with an array, so just display the variable
       Response.Write strName & " - " & Session.Contents(strName) & "<BR>"
     End If
   Next

%> 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?