如何跟踪用户信息(他访问过的页面,在页面中执行的任务) [英] how to track user information (pages he visited, task performed in a page)

查看:81
本文介绍了如何跟踪用户信息(他访问过的页面,在页面中执行的任务)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ASP.Net的新手...请解释我



如何存储用户信息(他访问过的页面,在页面中执行的任务)

喜欢gmail搜索历史和代码项目中的最新声誉事件。用编码来证明我...

i'm new to ASP.Net...kindly explain me

how to store the user information (pages he visited, task performed in a page)
like gmail search history and latest reputation events in code project.kindly expalin me with codings...

推荐答案

你无法跟踪一个人在ASP.NET应用程序的其他站点上的Web浏览器中所做的一切。您的代码本身就是一个浏览器命中的Web服务器。您可以跟踪一个人在您自己的网站上所做的一切,但不能跟踪其他人。
You can't track everything a person does in their webbrowser on other sitesfrom your ASP.NET application. Your code is itself, a web server that a browser hits. You can track everything a person does on your own site, but not others.


在我的下一篇文章 MVC基本站点:步骤4 - 使用AJAX,JSON,jQuery,LINQ和序列化的MVC 4.0中的jqGrid集成 [ ^ ]我提供了一个ASP.NET MVC应用程序框架管理访客日志。现在只存储用户名,登录日期,注销日期以及是否超时,但可以扩展以存储任意数量的信息。



1首先,你必须扩展现有的表,至少扩展表 VisitorLogs ;



2.然后你应该从 BaseController 类中将检查代码添加到下一个方法中: protected override void ExecuteCore()。该方法是在当前要执行的操作之前响应每个用户操作请求(来自网页)执行的,因此通过使用下一个代码:

In my next article MVC Basic Site: Step 4 – jqGrid Integration in MVC 4.0 using AJAX, JSON, jQuery, LINQ, and Serialization[^] I have provided an ASP.NET MVC application skeleton that manage the Visitors logs. Now only the user name,login date, the logout date and if was timeout or not are stored but could be extended to store as many info as you wanted.

1.First you have to extend the existing tables and at least the table VisitorLogs;

2. Then you should add your inspection code into the next method from BaseController class: protected override void ExecuteCore(). This method is executed in response to each user action request (from the web pages) just before the current action to be executed, so by using the next code:
System.Web.Routing.RouteValueDictionary routeValues = this.Url.RequestContext.Data.Value;
string controller = routeValues["controller"];
string action = routeValues["action"];



您将知道用户想要执行的当前控制器和操作,您可以将此信息存储到 VisitorLogs中 table。



3.要存储第二步的信息,你应该扩展类 VisitorLog 使用与 OnUserLogin()类似的新方法。


you will know the current controller and action that the user want to execute and you could stores this info into the VisitorLogs table.

3.To stores the info from the 2nd step your should extend the class VisitorLog with a new method similar with OnUserLogin() .


在ASP.NET中,您可以执行页面跟踪,例如< a href =http://dotnetslackers.com/articles/aspnet/Tracking-User-Activity.aspx>这个 [ ^ ]。



另外你可以访问此页 [ ^ ]进行一些搜索。



希望它有所帮助。
In ASP.NET you can do Page Tracking something like this[^].

Alternatively you can visit this page[^] to make some searches.

Hope it helps.


这篇关于如何跟踪用户信息(他访问过的页面,在页面中执行的任务)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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