日期:2014-05-18  浏览次数:20409 次

记录曾经浏览网站的IP人库
现在我有一个用asp.net 2.0开发的网站
现在要求记录曾经浏览网站的IP,
我不想在网站的每一页面都放置保存浏览者IP的代码
这样太消耗资源了把

有没有更好的方法??

------解决方案--------------------
IHttpModule
------解决方案--------------------
C# code

public void Init(HttpApplication context)
{
   context.BeginRequest += new EventHandler(context_BeginRequest);
}
void context_BeginRequest(object sender, EventArgs e)
{
   HttpApplication application = (HttpApplication)sender;
   HttpContext context = application.Context;
   //记录IP
}

------解决方案--------------------
up
------解决方案--------------------
按要求,session_start就行了吧?