如何使用C Sharp跟踪asp.net中页面上的用户活动 [英] how to track user activity on pages in asp.net using C sharp

查看:80
本文介绍了如何使用C Sharp跟踪asp.net中页面上的用户活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要跟踪他登录后的用户活动.
像他添加的记录一样,更新如何记录或仅记录他进行更改和更新的字段列表.


然后将此列表邮寄给管理员,以便这样的用户在数据库中进行了更改,并且更改了他所访问的字段和访问过的页面



请提供一些参考或代码.
或实现上述目的的一些步骤.
在此先感谢
Anil

解决方案

如果您只想跟踪用户访问的页面以及查询字符串等,则可以使用http handler.请参考此链接以进行简短介绍- http://support.microsoft.com/kb/308001 [ ^ ].网上有很多有关http处理程序的信息,请看一看.如果您想跟踪每一次特定的鼠标单击,那么在数据库和服务器上将非常困难.因此,我建议只记录页面和查询字符串.

如果您坚持要在页面中存储每个活动,则可能已经为实用程序类提供了一个方法,该方法将从每个方法调用中调用以记录所需的信息.但这绝对不是一个好主意!

希望这对您有帮助!


如果要跟踪用户对数据库所做的所有更改,那么最简单的方法是将事务日志添加到数据库.您甚至可以摆脱一个跟踪表名称,用户名,命令类型和更改摘要的表.如果您确实想要恒定的通知,则可以从数据库以及此新事务表上的插入/更新触发器中进行.

I want to track the user activity after he logged in.
Like which record he has added,Update how may record or only the list of the field he made changes and update.


And than mail this list to administrator that so an so user has made change in the database and the field that he has change and page he has visited



Please provide some references or code .
Or some step to achieve above mention thing.
Thanks In Advance
Anil

解决方案

In case you just want to track the pages a user visits along with query strings etc, you can use a http handler. Refer to this link for a short introduction - http://support.microsoft.com/kb/308001[^]. There is a lot more information on the net pertaining to http handlers, have a look at them. If you want to track every particular mouse click, it is going to be really hard on the database and the server. So, I would recommend just logging the pages and the query strings.

If you insist on storing every activity in a page, you may have provide a utility class with a method, that gets called from every method call to log information you need. But this definitely is not a good idea!

Hope this helps!


If you want to track all the changes users make to a database, then the easiest way would be to add a transaction log to the database. You can even get away with a single table that tracks the table name, the username, the commandtype, and a summary of the change. If you really want constant notification you can do that from the database as well from an insert/update trigger on this new transaction table.


这篇关于如何使用C Sharp跟踪asp.net中页面上的用户活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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