日期:2014-05-18 浏览次数:20411 次
string username = txtusername.Text; string password = txtpassword.Text; DataTable dt=user.UserLogin(username, MySecurity.Pw_Md5(password)); if (dt.Rows.Count == 1) { DataRow R = dt.Rows[0]; Session["usin_id"] = R["usin_id"].ToString(); Session["usin_nickname"] = R["usin_nickname"].ToString(); //txtNickname是一个Label txtNickname.Text = Session["usin_nickname"].ToString(); Response.Redirect(Request.Url.ToString()); } else { MyScript.ShowAndRedirect(this.Page, "用户名或密码错误", Request.Url.ToString()); }