Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Count hits with ASP code?
Message
General information
Forum:
Internet
Category:
Active Server Page
Miscellaneous
Thread ID:
00322578
Message ID:
00323030
Views:
21
>I am looking for an way of counting hits of a ASP page with some code in the ASP page.
>
>I know you can do this different ways, but what is the most simple?

2 techniques:

1******
Use a text file where you'll store a value
Load the value with the FileSystemObject in the Application_OnStart sub
Store the value in a Application variable
Increment the value in the Session_OnStart sub
Save the value to the text file in the Application_OnEnd sub

One problem with this technique: if your Web server crash, you loose some hits because you lost the value stored in the Application variable.



2****
Use a database to store the value
Call a store proc in the Session_OnStart sub that will increment the value
Guy Barrette, MCSD
============
Blog http://weblogs.asp.net/guybarrette
Microsoft Regional Director, Montreal, Canada www.microsoft.com/rd
MVP, ASP.NET http://mvp.support.microsoft.com/
President, Montreal Visual Studio User Group www.guvsm.net
INETA Regional Rep for Quebec www.ineta.org
UniversalThread Magazine Columnist (.NET Books Review Column) www.utmag.com
Tech Chair French Track, DevTeach 2004 & 2005 www.devteach.com
Business Architect, Microsoft Team - Nurun Inc www.nurun.com
XBox Live Gamer Tag: Slomo QC CA
Previous
Reply
Map
View

Click here to load this message in the networking platform