日期:2014-05-17 浏览次数:20406 次
if (this.ddlstatus.SelectedValue == "普通用户") { if (BaseClass.CheckStudent(txtNum.Text.Trim(), txtPwd.Text.Trim())) { Session["ID"] = txtNum.Text.Trim(); Session["name"] = txtNum.Text.Trim(); HttpCookie littcookie = new HttpCookie("UserloginName"); Response.Cookies["UserloginName"].Value = HttpUtility.UrlEncode(txtNum.Text, System.Text.Encoding.GetEncoding("gb2312")); //Cookies保存用户名 Response.Cookies["UserloginName"].Expires = DateTime.Today.AddDays(30); //设置过期时间, Tb_Student tb_Student = Tb_StudentManager.Instance.GetModelTb_StudentByWhere(" StudentNum='" + txtNum.Text.ToString() + "' "); Session["danwei"] =tb_Student.Danwei.ToString(); Session["keshi"] = tb_Student.Keshi.ToString();//科室 Session["shouji"] = tb_Student.Tel.ToString();//科室 Response.Redirect("student/studentexam.aspx"); }
try { if (Request.Cookies["UserloginName"] != null) { string nemaeusel = HttpUtility.UrlDecode(Request.Cookies["UserloginName"].Value, System.Text.Encoding.GetEncoding("gb2312")); }
HttpCookie cookie = new HttpCookie("test"); cookie.Value = "二哥"; cookie.Expires = DateTime.Now.AddDays(1); Response.Cookies.Add(cookie);