Previous PageNext Page

10.4 Counters Component

The Counter component creates a Counters object that can create, store, increment, and retrieve any number of individual counters.
 
A counter is a persistent value that contains an integer. You can manipulate a counter with the Get, Increment, Set, and Remove methods of the Counters object. Once you create the counter, it persists until you remove it.
 
Counters do not automatically increment on an event like a page hit. You must manually set or increment counters using the Set and Increment methods.
 
Counters are not limited in scope. Once you create a counter, any page on your site can retrieve or manipulate its value. For example, if you increment and display a counter named hits in a page called Page1.asp, and you increment hits in another page called Page2.asp, both pages will increment the same counter. If you hit Page1.asp, and increment hits to 34, hitting Page2.asp will increment hits to 35. The next time you hit Page1.asp, hits will increment to 36.
 
All counters are stored in a single text file, counters.txt.
 
Only create one Counters object in your site. This single Counters object can create any number of individual counters.
 

10.4.1.1 Registry Settings

The control makes use of no registry settings.
 

10.4.1.2 Control Reference

The Counters Control is registered with the ProgId of "MSWC.Counters". Create the Counters object one time on your site by adding the following to the Global.asa file:
 

      <OBJECT
      RUNAT=Server
      SCOPE=Application
      ID=Counter
      PROGID="MSWC.Counters">
      </OBJECT>

10.4.1.3 Properties

None

10.4.1.4 Methods

Get
Increment
Remove
Set


Copyright © 2000 Chili!Soft

Previous PageTop Of PageNext Page