Hits

The Hits method returns the number of times that a specified Web page has been opened.

Syntax

Object.Hits( [pathInfo] )

 

Parameters
pathInfo
Optional parameter that specifies the PATH_INFO of the Web page using the format /virtualdirectoryname/filename.asp. If this parameter is not specified, the hit count for the current page is displayed.
Return Values

A LONG indicating the number of times that the specified Web page has been opened.

Examples

The following example uses the Hits method to display the number of times that the current Web page has been opened.

<% Set MyPageCounter = Server.CreateObject("MSWC.PageCounter") %>

This Web page has been viewed <%= MyPageCount.Hits %> times.
<P>
Page Myscript.asp has been viewed <%= MyPageCounter.Hits("/VirtualDir1/Myscript.asp") %> times.
 
See Also

Reset, PageHit