Exemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var txt_acc = context.Request.Form["txt_acc"];
            var txt_pwd = context.Request.Form["txt_pwd"];
            var txt_Vallentity = context.Request.Form["txt_Vallentity"];
            if (txt_Vallentity != context.Session["Catcha"].ToString())
            {
                context.Response.Write("Valerror");
                return;
            }

            Member m = new Member();
            m.MAccount = txt_acc;
            m.MPassword = txt_pwd;
            MemberData md = new MemberData();
            var message = md.Ismember(m);
            if (message[0] == "Find")
            {
                context.Session["Member"] = message[1];
                context.Session["MName"] = message[2];
                context.Response.Write("OK");
            }
            else
            {
                context.Session["Member"] = "";
                context.Response.Write("NO");
            }
        }
Exemplo n.º 2
0
        public string isCheck(Member m)
        {
            OleDbConnection cn = new OleDbConnection(ConfigurationManager.ConnectionStrings["MyDb"].ConnectionString);
            cn.Open();
            query = "select * from Member where isdel = 0 and MAccount = '" + m.MAccount + "' and MPassword = '******'";
            OleDbCommand cmd = new OleDbCommand(query, cn);
            OleDbDataReader dr = cmd.ExecuteReader();

            if(dr.Read())
            {
                return "OK";
            }

            cn.Close();
            return "error";
        }