Exemplo n.º 1
0
        private void BindLogin()
        {
            LoginHistoryBLL          loginHistorybll = new LoginHistoryBLL();
            List <LoginHistoryModel> logins          = loginHistorybll.SelectLogin();

            Repeater1.DataSource = logins;
            Repeater1.DataBind();
        }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            string Name = context.Request.QueryString["Username"];
            string pwd  = context.Request.QueryString["pwd"];

            if (string.IsNullOrWhiteSpace(Name))
            {
                context.Response.Write("用户名不能为空");
                return;
            }
            if (string.IsNullOrWhiteSpace(pwd))
            {
                context.Response.Write("密码不能为空");
                return;
            }
            LoginBLL           loginBLL = new LoginBLL();
            administatorsModel result   = loginBLL.Login(Name, pwd);

            if (result.midName != null && result.mpassword != null)
            {
                context.Session["Name"] = result.midName;
                context.Session["Mid"]  = result.mid;

                int             Id         = result.mid;
                string          Name2      = result.midName;
                string          Ip         = GetAddressIP();
                LoginHistoryBLL historyBLL = new LoginHistoryBLL();
                historyBLL.insert(Id, Name2, Ip);
                context.Response.Write("成功");
            }
            else
            {
                context.Response.Write("用户名或密码输入错误");
            }

            context.Response.ContentType = "text/plain";
        }