Sun
ONE Active Server Pages Product Home Page Developer Site Version
 

ContentsPreviousNextIndex



Example: ASP Application Object Contents Collection

In the following script, objFSO, strHello, and Start_Time are members of the Application.Contents collection:

<%
Set Application("objFso") = Server.CreateObject("Scripting.FileSystemObject")
Application("strHello") = "Hello"
Application("Start_Time") = CStr(Now)
%>

The Application.Contents collection supports For...Each and For...Next iteration, as illustrated below.

<%
  For Each Key in Application.Contents
    Response.Write Key + " = " + Application(Key) + "<BR>"
  Next
%>
     
<%
  For intItem = 1 to Application.Contents.Count
    Response.Write CStr(intItem) + " = "
    Response.Write Application.Contents(intItem) + "<BR>"
  Next
%>


ContentsPreviousNextIndex