Ejemplo n.º 1
0
        public WebWorkContext(System.Web.HttpContext context)
        {
            if (context == null)
            {
                throw new Exception("上下文不能为空");
            }
            this.context = context;

            this.IsPost  = RequestHelper.IsPost(context.Request);
            this.IsAjax  = RequestHelper.IsAjax(context.Request);
            this.IP      = RequestHelper.GetCurrentIpAddress(context.Request);
            this.BaseUrl = RequestHelper.GetBaseUrl(context.Request);
            this.Url     = RequestHelper.GetCurrentUrl(context.Request);
            //login user
            LoadLoginUser();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取IP
 /// </summary>
 public static string Ip(this HttpContext context)
 {
     return(RequestHelper.GetCurrentIpAddress(context.Request));
 }
Ejemplo n.º 3
0
 public static string Ip(this HttpRequest req)
 {
     return(RequestHelper.GetCurrentIpAddress(req));
 }