我尝试在httpmodule里的Application_EndRequest方法记录用户访问页面
private void Application_EndRequest(object sender, EventArgs e)
{
var context = (sender as HttpApplication).Context;
LogService.Create(new LogEntity { UserID = Globals.GetCurrentUser().UserID, LogType = LogType.PV, Remark = context.Request.RawUrl, CreateTime = DateTime.Now });
}
但是,这样会记录到N多css js img 等。。。。请问,在这个框架下,如何正确记录当前访问的url?
谢谢!
===================================================
这只能是在module里判断下了。。
直接用IIS的日志就是了,干嘛还要自己搞个。
可以用LogParser查询IIS日志。相关工具如下:
LogParser:http://www.microsoft.com/en-us/download/details.aspx?id=24659
LogParserLizardSetup:http://www.lizard-labs.net/Download.aspx?fname=LogParserLizardSetup.msi