protected void btnSave_Click(object sender, EventArgs e) { string name = txtName.Text.Trim(); string password = txtPassword.Text.Trim(); BLL.Users users = new BLL.Users(); DataSet ds = users.GetList("Name='" + name + "' and Password='******'"); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["IsActivity"].ToString() == "True") { Session["LoginUser"] = ds.Tables[0].Rows[0]["Id"]; Response.Redirect("~/Default.aspx"); } else { Maticsoft.Common.MessageBox.Show(this, "未激活用户!"); } } else { Maticsoft.Common.MessageBox.Show(this, "用户名或密码错误!"); } }