📄 global.cs
字号:
//======================================================
//== (c)2008 aspxcms inc by NeTCMS v1.0 ==
//== Forum:bbs.aspxcms.com ==
//== Website:www.aspxcms.com ==
//======================================================
using System;
using System.Web;
using System.Text;
using NetCMS.Model;
namespace NetCMS.Global
{
public class Current
{
public static string SiteID
{
get
{
return GetInfo().SiteID.Trim();
}
}
public static string UserNum
{
get
{
return GetInfo().UserNum;
}
}
public static string UserName
{
get
{
return GetInfo().UserName;
}
}
public static string ClientIP
{
get
{
return HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}
}
public static bool IsTimeout()
{
try
{
GlobalUserInfo info = GetInfo();
return false;
}
catch
{
return true;
}
}
public static void Set(GlobalUserInfo info)
{
HttpContext.Current.Session["SITEINFO"] = info;
}
private static GlobalUserInfo GetInfo()
{
if (HttpContext.Current.Session["SITEINFO"] == null)
throw new Exception("您没有登录系统或会话已过期,请重新登录");
//return (GlobalUserInfo)HttpContext.Current.Session["SITEINFO"];
else
return (GlobalUserInfo)HttpContext.Current.Session["SITEINFO"];
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -