zoukankan      html  css  js  c++  java
  • session相关----高手请跳过!

    session[“username”]=null;//Session.Remove(“username”);的结果是session[“username”]=null了

    session[“username”]=””;

    session.clear();//表示将会话中所有的session的键值都清空,但是session还是依然存在,同等于Session.RemoveAll()

    session.abandon();

    //---------------------------------自己写的小栗子----------------------------------------------------------------------------------

    Session["username"] = "xxj";
                Response.Write("username:"+Session["username"]);
                //Session.Remove("username");//值为NULL
                //Session.Abandon();//值不为NULL,为xxj
                Session.Clear();//Session.Clear只是清除Session中的所有数据并不会中止该Session,值为NULL

               
                //Response.Write("移除后的username:" + Session["username"]);
                if (Session["username"] == null)
                {
                    Response.Write("session["username"]真的为NULL了");
                }
               
                else
                {
                    Response.Write("session["username"]不为NULL,session["username"]的值为" + Session["username"]);
                }

    参考:http://www.cnblogs.com/shuang121/archive/2011/03/02/1968768.html

  • 相关阅读:
    事件的解密
    C#世界中的委托
    这次是C#中的接口
    完全二叉树的建立和翻转
    全排列的应用
    网易笔试-按位或运算
    柱状图的最大矩形--单调栈
    Linux将线程绑定到CPU内核运行
    Windows多线程与线程绑定CPU内核
    B+树介绍
  • 原文地址:https://www.cnblogs.com/QMM2008/p/4026910.html
Copyright © 2011-2022 走看看