如何获得独特的没有。访问

问题描述:

朋友,我想得到总数。独特访问。

一个逻辑是---

获取IP地址并从数据库中检查它是否不可用然后递增计数器

否则不会。

但这需要很长时间才能使网站变慢。这样可行吗?







有没有其他方法可以做到这一点。

请建议我



提前...

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...

读取IP非常快:Request.UserHostAddress也会立即给你。在人类方面,SQL检查也不应该很长 - 它只是一个简单的查询:

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:
SELECT COUNT(*) FROM IPTable WHERE IPAddress='100.100.100.100'

并且可以作为ExecuteScalar执行以仅返回值。 0意味着它不在那里。



那么它为什么要慢?

但是,你应该知道所有用户在相同的互联网连接上将具有相同的IP地址 - 因此来自同一公司的所有用户都可能匹配。

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.


您好,



你需要与global.asx做一点,请使用以下链接:





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





希望它能解决您的问题。



谢谢

Neha Sharma

nehaprogrammer.blogspot.in
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