标签:http os io new ad res on sp
一、Cookie
设置 cookie
HttpCookie cookie = new HttpCookie(name);
cookie.Value = user.UserID.ToString();
Response.Cookies.Add(cookie);
读取cookie
System.Web.HttpContext.Current.Request.Cookies[name].Value
二、Session
设置session
HttpContext.Current.Session.Add(name, value);
根据session名获取session对象
HttpContext.Current.Session[name];
cookie和session的设置和读取,布布扣,bubuko.com
标签:http os io new ad res on sp
原文地址:http://www.cnblogs.com/huangfenggu/p/3910898.html