counting no of users so far

Results 1 to 2 of 2

Thread: counting no of users so far

  1. #1
    dsk Guest

    Default counting no of users so far

    counting no of users had visited this site since some date.<BR>please give me the code.<BR><BR><BR>

  2. #2
    Shrey Gour Guest

    Default RE: counting no of users so far

    The Answer is there in MSDN<BR>Counters Component<BR>The Counter component creates a Counters object that can create, store, increment, and retrieve any number of individual counters. <BR><BR>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.<BR><BR>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.<BR><BR>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.<BR><BR>All counters are stored in a single text file, Counters.txt, which is located in the same directory as the ounters.dll file. <BR><BR>File Name Description <BR>Counters.dll The Counters component. <BR>Counters.txt The file that stores all individual counters on a site. Counters.txt is a UTF8-encoded file. You can have any Unicode characters in a counter name. <BR><BR><BR>Syntax<BR>Create the Counters object one time on your server by adding the following to the Global.asa file:<BR><BR>&#060;OBJECT <BR>RUNAT=Server <BR>SCOPE=Application <BR>ID=Counter <BR>PROGID="MSWC.Counters"&#062; <BR>&#060;/OBJECT&#062;<BR><BR>Remarks<BR>Only create one Counters object in your site. This single Counters object can create any number of individual counters.<BR><BR>Note For Internet Information Services on Windows® 95 or later, a Counters component has already been specified in the Global.asa file in the default virtual directory. You can work with the Counters object the component creates as if it were a built-in object by calling Counters.Get, Counters.Increment, Counters.Remove, and Counters.Set. You should not create another instance of the Counters object.<BR><BR>Methods <BR>Get Returns the value of the counter. <BR>Increment Increases the counter by 1. <BR>Remove Removes the counter from the Counters.txt file. <BR>Set Sets the value of the counter to a specific integer. <BR><BR><BR>Example<BR>Create an instance of the Counters object in the Global.asa file with the ID attribute set to Counter: <BR><BR>&#060;OBJECT RUNAT=Server SCOPE=Application ID=Counter PROGID="MSWC.Counters"&#062; &#060;/OBJECT&#062;<BR> <BR>You can then use that Counters object on one page to create all the counters you need:<BR><BR>There have been &#060;%= Counter.Increment(&#039defaultPageHits&#039) %&#062; to this site.<BR> <BR>Then on another page you can increment the counter in the following manner:<BR><BR>You are visitor number&#060;%= Counter.Increment(&#039LinksPageHits&#039) %&#062; to this page.<BR> <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts