Lista de variables de sesion y aplicación


/ Published in: ASP
Save to your folder(s)

List Session and Application Variables


Copy this code and paste it in your HTML
  1. <%@ Language=VBScript %>
  2. <% Option Explicit %>
  3. <%
  4. 'How many session variables are there?
  5. Response.Write "There are " & Session.Contents.Count & _
  6. " Session variables<P>"
  7.  
  8. Dim strName, iLoop
  9. 'Use a For Each ... Next to loop through the entire collection
  10. For Each strName in Session.Contents
  11. 'Is this session variable an array?
  12. If IsArray(Session(strName)) then
  13. 'If it is an array, loop through each element one at a time
  14. For iLoop = LBound(Session(strName)) to UBound(Session(strName))
  15. Response.Write strName & "(" & iLoop & ") - " & _
  16. Session(strName)(iLoop) & "<BR>"
  17. Next
  18. Else
  19. 'We aren't dealing with an array, so just display the variable
  20. Response.Write strName & " - " & Session.Contents(strName) & "<BR>"
  21. End If
  22. Next
  23.  
  24. %>

URL: http://www.psacake.com/web/hl.asp

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.