<% ' Purpose: Display all the application collections %>
<!-- Content -->
<!--
The Application and Session Variable collection is a new features of
IIS 4.0 the code below was added since IIS 4.0 released
-->
<h3> Application Variable Collection </h3>
<%
On Error Resume Next
For Each Item in Application.Contents
  Response.Write Item & " = " & Application.Contents(Item) & "<BR>"
  For Each ItemKey in Application.Contents(Item)
    Response.Write "Sub Item: " & Item & " (" & ItemKey & ") : " _
    & Application.Contents(Item)(ItemKey) & "<br>"
  Next
Next ' Key
if err.no > 0 Then Display "You must upgrade to IIS 4.0 in order to use the
Application Collection<br>"
%>
<!-- All collections at the code below are available at IIS 3.0 -->
<h3> Session Variable Collection </h3>
<%
On Error Resume Next
For Each Item in Session.Contents
  Response.write Item & " = " & Session.Contents(Item) & "<BR>"
  For Each ItemKey in Session.Contents(Item)
    Response.Write "Sub Item: " & Item & " (" & ItemKey & ") : " _
    & Session.Contents(Item)(ItemKey) & "<br>"
  Next
Next
if err.no > 0 Then Display "You must upgrade to IIS 4.0 in order to use the
Session Collection<br>"
%>
<h3> QueryString Collection </h3>
<%
For Each Item in Request.QueryString
  For iCount = 1 to Request.QueryString(Item).Count
    Response.Write Item & " = " & Request.QueryString(Item)(iCount) & "<br>"
  Next
Next
%>
<h3> Form Collection </h3>
<%
For Each Item in Request.Form
  For iCount = 1 to Request.Form(Item).Count
    Response.Write Item & " = " & Request.Form(Item)(iCount) & "<br>"
  Next
Next
%>
<h3> Cookies Collection </h3>
<%
For Each Item in Request.Cookies
  If Request.Cookies(Item).HasKeys Then
    'use another For...Each to iterate all keys of dictionary
    For Each ItemKey in Request.Cookies(Item)
      Response.Write "Sub Item: " & Item & "(" & ItemKey & ")"
      Response.Write " = " & Request.Cookies(Item)(ItemKey)
    Next
  Else
    'Print out the cookie string as normal
    Response.Write Item & " = " & Request.Cookies(Item) & "<br>"
  End If
Next
%>
<h3> ClientCertificate Collection </h3>
<%
For Each Item in Request.ClientCertificate
  For iCount = 1 to Request.ClientCertificate(Item).Count
    Response.Write Item & " = " & Request.ClientCertificate(Item)(iCount) _
    & "<br>"
  Next
Next
%>
<h3> ServerVariables Collection </h3>
<%
For Each Item in Request.ServerVariables
  For iCount = 1 to Request.ServerVariables(Item).Count
    Response.Write Item & " = " & Request.ServerVariables(Item)(iCount) _
    & "<br>"
  Next
Next
%>
<p><font SIZE="2"><cite>Modified code from Wrox Press Limited</cite></font>
