Session统一管理类
具体查看EsalesWeb这个项目
public class UserSessionClass
{
    public static string GetClientSessionID
    {
        get
        {
            try
            {
               return HttpContext.Current.Session["UserAccountId"].ToString();
            }
            catch
            {
                throw new Exception("您已超时,请从新登陆!");
            }
        }
        set
        {
            HttpContext.Current.Session["UserAccountId"]=value;
        }
    }

    public static string GetBlockName
    {
        get
        {
            try
            {
                return HttpContext.Current.Session["blockName"].ToString();
            }
            catch
            {
                throw new Exception("您已超时,请从新登陆!");
            }
        }
        set
        {
            HttpContext.Current.Session["blockName"] = value;
        }
    }
}

posted on 2006-07-23 22:52  砍才  阅读(907)  评论(0编辑  收藏  举报