读书人

设立session

发布时间: 2012-12-27 10:17:10 作者: rapoo

设置session

?

    /// <summary>    /// 设置Session    /// </summary>    /// <param name="name"></param>    /// <returns></returns>    [WebMethod(EnableSession = true)]    public static bool setSession(string name)    {        HttpContext.Current.Session["name"] = System.Web.HttpUtility.UrlDecode(name);        return true;    }    /// <summary>    /// 获取session    /// </summary>    /// <returns></returns>    [WebMethod(EnableSession = true)]    public static string getSession()    {        return HttpContext.Current.Session["name"].ToString();    }

读书人网 >编程

热点推荐