Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
friends i want to get total no. of unique visits .
one logic is that ---
fetch the ip address and check from data base if its not available then increment the counter
otherwise not.
But it would take much time and make the site slow.Is it feasible?



is there any other method to do this.
pls suggest me

thanx in advance...
Posted
Comments
Zoltán Zörgő 15-Feb-13 7:16am    
Are you in an intranet? Are the IP addresses fixed?

Reading the IP is very quick: Request.UserHostAddress will give it too you immediately. The SQL check should not be long in human terms either - it's just a simple query:
SQL
SELECT COUNT(*) FROM IPTable WHERE IPAddress='100.100.100.100'
and can be executed as a ExecuteScalar to return just the value. 0 means it's not in there.

So why should it be slow?
However, you should be aware that all users on teh same internet connection will have the same IP address - so all users from the same company will probably match.
 
Share this answer
 
Comments
fjdiewornncalwe 15-Feb-13 11:02am    
+5.
Hi ,

you need to do a bit with global.asx,please go with the below link :


http://www.sujitbhujbal.com/2012/12/how-to-count-website-visitors-in-aspnet.html[^]


hope it ll solve your issue.

Thanks
Neha Sharma
nehaprogrammer.blogspot.in
 
Share this answer
 
Comments
maan_k 15-Feb-13 7:39am    
thanx.,but i need the total no. of unique visits.I visited above link, here the code written is for total no. of visits.it will increment the counter in both cases whether the user is visited earlier or not.
nehas1jan 15-Feb-13 7:45am    
Hi,

Then go with these links ll defenatly solve the issues :

http://stackoverflow.com/questions/764976/asp-net-tracking-code-unique-visitors

http://www.codeguru.com/csharp/.net/net_asp/article.php/c19443/Tracking-Visitors-with-ASPNET.htm

All the Best!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900