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

编程入门 行业动态 更新时间:2024-10-25 08:17:20
本文介绍了如何获得独特的没有。访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

朋友,我想得到总数。独特访问。 一个逻辑是--- 获取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做一点,请使用以下链接: www.sujitbhujbal/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 : www.sujitbhujbal/2012/12/how-to-count-website-visitors-in-aspnet.html[^] hope it ll solve your issue. Thanks Neha Sharma nehaprogrammer.blogspot.in

更多推荐

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

本文发布于:2023-10-28 05:25:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535656.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何获得   独特

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!