登录ASP.NET站点的用户操作? [英] Logging user actions on ASP.NET site?

查看:79
本文介绍了登录ASP.NET站点的用户操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要的是它记录的方法由用户和他们中的返回值称为如果他们有系统。例如,在用户登录和他/她在冲浪我的web应用。那么自然他/她点击出头,所以他/她触发一些事件方法不管然后我的日志系统必须登录该方法的名称和时间标记与用户的登录名或ID到数据库结合起来。

What I want is system which is logging methods called by users and their returning values if they have. For example a user logs in and he/she is surfing on my web app. then naturally he/she clicks on somethings and so he/she fires up some event method whatever then my log system must log this method name and time stamp combined with user login name or id into database.

所以,我该怎么办,在asp.net。

So how can I do that in asp.net.

推荐答案

那么,的简单的方法是把所有的日志语句添加到您的code,使用日志框架,如 log4net的。如果你想这样做的更加自动的方式,你可能要考虑 PostSharp ,这样你可以只装饰适当的方法与属性 - 但如果你有很多的事件来记录肯定更复杂,可能只值得

Well, the simplest way is just to add all the logging statements to your code, using a logging framework such as Log4Net. If you want a more automatic way of doing this, you might want to look into PostSharp so that you could just decorate the appropriate methods with an attribute - but that's certainly more complex, and probably only worth it if you have a lot of events to log.

这篇关于登录ASP.NET站点的用户操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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