标签:username tpc ring cookies use add response set pre
1.创建cookie
HttpCookie userCookie = new HttpCookie("userInfo"); userCookie["name"] = Request.Form["username"].ToString(); userCookie["pwd"] = Request.Form["pwd"].ToString(); userCookie.Expires = DateTime.Now.AddHours(1); //设置过期时间 Response.SetCookie(userCookie);
2.获取cookie
Request.Cookies["userInfo"]["name"].ToString();
标签:username tpc ring cookies use add response set pre
原文地址:http://www.cnblogs.com/zhuxiang1633/p/7625509.html