在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
一、写入: HttpCookie cook = new HttpCookie("abcname"); cook.Expires = DateTime.Now.AddYears(1);//设定过期时间 cook["username"] = user.Uname; Response.Cookies.Add(cook); 二、读取: HttpCookie cook = Request.Cookies["abcname"]; string name = string.Empty; if (cook != null) { name = Convert.ToString(cook["username"]); }
|
请发表评论