module define:
public class HttpModuleTrack : IHttpModule, IRequiresSessionState
{
#region IHttpModule 成员
public void Dispose()
{
}
public void Init(HttpApplication context)
{
context.AcquireRequestState += new EventHandler(context_AcquireRequestState);
}
void context_AcquireRequestState(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["a"]))
{
HttpContext.Current.Session["affiliateid"] = HttpContext.Current.Request.QueryString["a"];
}
if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["b"]))
{
HttpContext.Current.Session["bannerid"] = HttpContext.Current.Request.QueryString["b"];
}
}
#endregion
}
web.config: