© 1999-2048 dssz.net 粤ICP备11031372号
Cookie ck = new Cookie();
/// ck.setCookie("主键","键值","天数");
public bool setCookie(string strName , string strValue, int strDay) { try { HttpCookie Cookie = new HttpCookie(strName); Cookie.Expires = DateTime.Now.AddDays(strDay); Cookie.Value = strValue; System.Web.HttpContext.Current.Response.Cookies.Add(Cookie); return true; } catch { return false; } } ...展开收缩