View Single Post
  #2 (permalink)  
Old August 22nd, 2004, 05:34 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You'll get into problems when there are two users starting a session at exactly the same time as indeed the file will be locked by the first users when the second tries to write to it.

That's why I am saying this at the end of the article:
Quote:
quote:A disadvantage of using text files is that it's difficult to scale out your Web site to lots of users. Only one user has access to the file at any given moment, so if you have a real busy site, you'll soon run into problems.
Take a look at the following article to see how you can improve the counter page even further by using a database instead of a text file.
Howto Create a Hit Counter Using a Database in ASP.NET
Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.