Based on this piece of code, I want to do exactly like this demonstration. However, correct me if I'm wrong but if two or more users somehow simultaneously access the web page at the same precise nanosecond in time, then wouldn't we have a race condition? So is this piece of code valid? How would I correct this to make it thread safe???
If you like to support this site, feel free to make a donation to support improvements.
Monetize Your Blog
How to track visitors to your site in ASP.NET & C#
Code to log the IP address & DNS name for visitors to each page
Posted on 4/3/2007 1:52:07 PM in #ASP.NET
[lnkImage] [lnkImage] [lnkImage] [lnkImage] [lnkImage] [lnkImage] [lnkImage] [lnkImage] [lnkImage] [lnkImage] [lnkImage] [lnkImage] ASP.NET Social Bar? Get A Free one here!
Once you have published a site in ASP.NET, you'd like to know who are your visitors. One way is to check your event log on the host server. Another option is to write your own code. You'd basically like to log the IP address, and DNS name for the visitor, and it would be nice to know which page they are visiting.
To log the ip address using ASP.NET, you can call:
Another usefull variable is
View Complete Post