private void btnLogin_ServerClick(object sender, EventArgs e) { DataProviders providers = new DataProviders(); system system = new system(); WebLogic logic = new WebLogic(); string adminid = system.ChkSql(this.admin_id.Value.ToString()); string password = system.ChkSql(this.admin_pwd.Value.ToString()); if (this.vcode.Value != this.Session["VerifyCode"].ToString()) { base.Response.Write("<script language=javascript>alert(\"驗證碼錯誤!\")</script>"); } else { logic.log("", "", adminid, 0, "登陸後臺", this.Page.Request.UserHostAddress.ToString(), "後台登陸日誌"); logic.log("", "", adminid, 0, "登陸後臺", system.GetClientIP(), "後台登陸日誌"); SqlDataReader reader = providers.ExecuteSqlDataReader("select * from mhcmember..web_login where userid='" + adminid + "' and password='******' and state=1"); if (reader.Read()) { this.Session.Timeout = 600; this.Session["admin_id"] = reader["userid"].ToString(); this.Session["admin_name"] = reader["name"].ToString(); this.Session["admin_ip"] = system.GetClientIP(); base.Response.Redirect("cpserverinfo.aspx"); } else { base.Response.Write("<script language=javascript>alert(\"用戶名或密碼錯誤!\")</script>"); } providers.CloseConn(); } }
private void btnLogin_ServerClick(object sender, EventArgs e) { DataProviders providers = new DataProviders(); system system = new system(); WebLogic logic = new WebLogic(); string agentid = system.ChkSql(this.agent_id.Value.ToString()); string str2 = system.ChkSql(this.agent_pwd.Value.ToString()); if (this.vcode.Value != this.Session["VerifyCode"].ToString()) { base.Response.Write("<script language=javascript>alert(\"驗證碼錯誤!\")</script>"); } else { SqlDataReader reader = providers.ExecuteSqlDataReader("select * from mhcmember..web_agent where userid='" + agentid + "' and password='******' and state=1"); if (reader.Read()) { this.Session.Timeout = 600; this.Session["agent_id"] = reader["userid"].ToString(); this.Session["agent_name"] = reader["name"].ToString(); this.Session["agent_ip"] = system.GetClientIP(); logic.log("", agentid, "", 0, "代理後台登陸成功", system.GetClientIP(), "代理登陸日誌"); base.Response.Redirect("account.aspx"); } else { logic.log("", "", agentid, 0, "用戶名或密碼錯誤ID:" + agentid + "PW:" + str2, system.GetClientIP(), "代理登陸日誌"); base.Response.Write("<script language=javascript>alert(\"用戶名或密碼錯誤!\")</script>"); } } }