home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / Application_VBScript.asp < prev    next >
Text File  |  1997-10-25  |  2KB  |  60 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <%  Option Explicit     %>
  3.  
  4. <%
  5.     ' Ensure that this page is not cached
  6.     Response.Expires = 0
  7. %>
  8.  
  9. <HTML>
  10.     <HEAD>
  11.         <TITLE>Using Application Variables</TITLE>
  12.     </HEAD>
  13.  
  14.     <BODY BGCOLOR="White" topmargin="10" leftmargin="10">
  15.  
  16.         <!-- Display Header -->
  17.  
  18.         <font size="4" face="Arial, Helvetica">
  19.         <b>Using Application Variables</b></font><br>
  20.       
  21.         <hr size="1" color="#000000">
  22.  
  23.  
  24.         <%
  25.             ' If this is the first time any user has visited
  26.             ' the page, initialize Application Value
  27.  
  28.             If (Application("AppPageCountVB") = "") Then
  29.                 Application("AppPageCountVB") = 0
  30.             End If
  31.  
  32.  
  33.             ' Increment the Application AppPageCount by one.
  34.             ' Note that this AppPageCount value is being
  35.             ' shared, locking must be used to prevent 
  36.             ' two sessions from simultaneously attempting 
  37.             ' to update the value.
  38.  
  39.             Application.Lock
  40.             Application("AppPageCountVB") = Application("AppPageCountVB") + 1
  41.             Application.UnLock
  42.         %>
  43.  
  44.  
  45.         <!-- Output the Application Page Counter Value -->
  46.         <!-- Note that locking does not need to be used -->
  47.         <!-- because the value is not being changed by -->
  48.         <!-- this user session -->
  49.  
  50.         Users have visited this page 
  51.         <%=Application("AppPageCountVB")%> times!
  52.  
  53.  
  54.         <!-- Provide a link to revisit the page -->
  55.  
  56.         <p><A href = "Application_VBScript.asp">Click here to visit it again</A>
  57.  
  58.     </BODY>
  59. </HTML>
  60.