Beispiel #1
0
        public string entry(string name, string pwd)
        {
            string MM = FormsAuthentication.HashPasswordForStoringInConfigFile(pwd, "MD5");

            Maticsoft.Model.Operator oauser = lBLL.GetModelS("name='" + name + "' and pwd='" + MM + "'");
            if (oauser != null)
            {
                string qqq = @"{""data"":{""ds"":""1"",""userid"":""" + oauser.id + "\"}}";
                return(qqq);
            }
            else
            {
                return(@"{""data"":{""ds"":""0""}}");
            }
        }
Beispiel #2
0
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            if (this.uname.Value.Trim() == "'or'='or'" || this.pwd.Value.Trim() == "'or'='or'")
            {
                Response.Write("<script>alert('别开玩笑行不行!')</script>");
            }
            else
            {
                string MM = FormsAuthentication.HashPasswordForStoringInConfigFile(this.pwd.Value.Trim(), "MD5");

                Maticsoft.Model.Operator oauser = lBLL.GetModelS("name='" + this.uname.Value.Trim() + "' and pwd='" + MM + "'");
                if (oauser != null)
                {
                    Session["user"] = oauser;
                    Response.Redirect("~/index.aspx");
                }
                else
                {
                    Response.Write(string.Format("<script>alert('用户名或密码错误!');location='login.aspx'</script>"));
                }
            }
        }