基于用户会话的asp.net中的计数器 [英] Counter in asp.net based on user session

查看:49
本文介绍了基于用户会话的asp.net中的计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个查询,我想在我的应用程序中实现计数器,该计数器基于用户会话,而不是基于点击页面的用户数量.会话识别每次访问的用户.每当特定用户点击时,页面计数器都会根据其会话ID来计算其访问总次数.任何想法... ??

我略有想法,需要在Global.asmx文件的

Hi,

I have a query, I want to implement counter in my application which is based on user session not on number of user who hit the page. The Session recognizes the users at each and every visit. Whenever a particular user hit the page counter will count his total number of visit based on his session id. Any Ideas...??

I have a slight idea that something needs to be done in the

Session_Start

事件中进行某些操作.

我猜是类似 [

Event in the Global.asmx file.

I guess something like this[^] should work.

Thanks and Regards,
Anil Chaudhary.

推荐答案



我以前也做过同样的事情,但是现在没有可用的代码段.

我们所做的是
1.创建一个表(用户ID,操作,页面名称,事件名称(您不需要此名称),日期)
2.每次用户访问页面时,我们都会在db
中插入一行 3.在特定日期没有行将是相应用户的计数器.


希望这会有所帮助.....
Hi

I have done the same before but I dont have code snippet available right now with me.

What we have done is
1.Create a table(userID, action,pagename,eventname(you dont need this),date)
2.Each time when user visits the page we will insert a row in db
3.No of rows on a particular date will be the counter of the respective user.


Hope this helps.....


阅读本文
< a href ="http://msdn.microsoft.com/en-us/library/fxk122b4.aspx"> http://msdn.microsoft.com/en-us/library/fxk122b4.aspx</a> ; [< a href ="http://msdn.microsoft.com/zh-cn/library/fxk122b4.aspx" target ="_ blank" title =新窗口"> ^</a>]
Go through this article
<a href="http://msdn.microsoft.com/en-us/library/fxk122b4.aspx">http://msdn.microsoft.com/en-us/library/fxk122b4.aspx</a>[<a href="http://msdn.microsoft.com/en-us/library/fxk122b4.aspx" target="_blank" title="New Window">^</a>]


这篇关于基于用户会话的asp.net中的计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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