zoukankan      html  css  js  c++  java
  • session操作类

    using System;
    using System.Web;
    /// <summary> ///session操作类 /// </summary> public class appCookie { #region COOKIE 操作相关 /// <summary> /// 写入Cookie /// </summary> /// <param name="strName"></param> /// <param name="strValue"></param> public static void WriteCookie(string strName, string strValue) { WriteCookie(strName, strValue, 30); } public static void WriteCookie(string strName, string strValue, int expires) { HttpCookie cookie = HttpContext.Current.Request.Cookies[strName]; if (cookie == null) { cookie = new HttpCookie(strName); } //cookie.Domain = domain; cookie.Value = strValue; cookie.Expires = DateTime.Now.AddDays((double)expires); HttpContext.Current.Response.AppendCookie(cookie); } public static string GetCookie(string strName) { if (((HttpContext.Current.Request.Cookies != null) && (HttpContext.Current.Request.Cookies[strName] != null))) { return HttpContext.Current.Request.Cookies[strName].Value; } return ""; } #endregion }
  • 相关阅读:
    左式堆
    winsock库
    二叉堆
    关键字explicit
    HDOJ 1012
    HDOJ 1013
    STL priority实例
    二项队列
    ASP.NET Session过期问题揭秘
    RenderControl (asp.net)
  • 原文地址:https://www.cnblogs.com/mengxingxinqing/p/3164945.html
Copyright © 2011-2022 走看看