Referral or Affiliate Code tracking Module in ASP.NET

来源:互联网 发布:用友软件的售后 编辑:程序博客网 时间:2024/05/22 03:12

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:

原创粉丝点击