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;
}
}
}