檢視ASP Session 變數的小工具 (轉)

worldblog發表於2007-12-13
檢視ASP Session 變數的小工具 (轉)[@more@]


'#####################################################
'Function: 
'  List server Session variable &  Application  variable
'Author: Hardy He
'Date:  -3-12 23:30
'Memo: Be care for diffrent virtul path show diffrent Session
'#####################################################
%>


  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 ""
  If Is(Session.Contents(sessitem)) Then
    Response.Write  ""
    Response.Write  ""
    Response.Write  ""
  Else
  If IsArray(Session.Contents(sessitem)) Then 
    Response.Write  ""
  Response.Write  "" + ""
 
  Else
    Response.Write  ""
  Response.Write  ""
  Response.Write  "" 
  End If
  End If
  response.write ""
  intItem=intItem+1 
  Next
 
%>
"+CStr(intItem) + ""+sessitem+ ""+"Session object"+ ""+CStr(intItem) + ""+"Array Object "+ ""
 
  For each objArray in Session.Contents(sessitem)
  Response.Write  "***;"
  Next
  Response.Write "
"+CStr(intItem) + ""+ sessitem + ""+ CStr(Session.Contents(sessitem)) + "





LIST Application




  intItem=1
  For Each Key in Application.Contents

  Response.Write  "

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

 


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-992929/,如需轉載,請註明出處,否則將追究法律責任。

相關文章