页面浏览次数 [英] how many time a page view

查看:132
本文介绍了页面浏览次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发展社交门户.我想做一些事情,例如在此网站上浏览用户个人资料的次数,问题的看法.

I develop socialportal. I want to do some thing like how many times a profile of a user is viewed like on this website, the views of a question.

推荐答案

方式:

http://madskristensen.net/post/Track-your-visitors-using-an- HttpModule.aspx [ ^ ]

在非常基础的级别上,您可以为HTTP服务器日志编写一个解析器.

一种更复杂的方法是在服务器端代码中执行此操作.可能有现有的库对此有所帮助.但是最终归结为保存访问者的IP地址和/或已登录用户的配置文件(如果需要此信息)以及日期时间戳.
Here''s one way to do this:

http://madskristensen.net/post/Track-your-visitors-using-an-HttpModule.aspx[^]

At a very elementary level you could write a parser for your HTTP server logs.

A slightly more involved approach would be to do this in the server side code. There may be existing libraries that help with this. But eventually it comes down to saving the IP address and/or logged-in user profile of the visitor (if you need that info) along with a date-time stamp.


一种方法是设置每次打开页面时都会增加计数器的过程.您知道用户是谁,因此在用户表中添加一列并每次更新都应该很简单.剩下的我留给你弄清楚.这是一个非常琐碎的过程.
One way would be to set up a process that increments a counter each time the page is opened. You know who the user is so it should be simple to add a column to the user table and update that each time. The rest I leave to you to figure out; this is a very trivial process.


您可以在母版页中放置一些内容-我的某些内容确定了显示的aspx页的最后编辑日期.添加更多代码以将此信息存储在某处(例如在数据库中),将是一项简单的任务.我的托管公司不允许使用Httpmodules,因此这几乎是我唯一的选择.
You could put something in your master page - I have something in mine that determines the last edited date of the aspx page that''s being displayed. It would be a simple task to add a little more code to store this info somewhere (like in a database). My hosting company doesn''t allow Httpmodules, so this is pretty much my only option.


这篇关于页面浏览次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆