Exemplo n.º 1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (IsPostBack)
            {
                return;
            }

            VerifyAdministratorPermissions(ConfigManager.Permissions.Settings.Utility);

            var parameterList = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("系统主机名", ComputerUtils.GetHostName()),
                new KeyValuePair <string, string>("系统根目录地址", WebConfigUtils.PhysicalApplicationPath),
                new KeyValuePair <string, string>("系统程序目录地址", PathUtils.PhysicalSiteServerPath),
                new KeyValuePair <string, string>("计算机的网卡地址", ComputerUtils.GetMacAddress()),
                new KeyValuePair <string, string>("计算机的CPU标识", ComputerUtils.GetProcessorId()),
                new KeyValuePair <string, string>("计算机的硬盘序列号", ComputerUtils.GetColumnSerialNumber()),
                new KeyValuePair <string, string>("域名", PageUtils.GetHost()),
                new KeyValuePair <string, string>("访问IP", PageUtils.GetIpAddress()),
                new KeyValuePair <string, string>(".NET版本", Environment.Version.ToString()),
                new KeyValuePair <string, string>("SiteServer CMS 版本", SystemManager.Version),
                new KeyValuePair <string, string>("最近升级时间", DateUtils.GetDateAndTimeString(ConfigManager.Instance.UpdateDate)),
                new KeyValuePair <string, string>("数据库类型", WebConfigUtils.DatabaseType.Value),
                new KeyValuePair <string, string>("数据库名称", SqlUtils.GetDatabaseNameFormConnectionString(WebConfigUtils.DatabaseType, WebConfigUtils.ConnectionString))
            };

            RptContents.DataSource     = parameterList;
            RptContents.ItemDataBound += RptContents_ItemDataBound;
            RptContents.DataBind();
        }
Exemplo n.º 2
0
        public string PrintParameter()
        {
            var builder  = new StringBuilder();
            var hostName = ComputerUtils.GetHostName();

            builder.Append($"<tr><td>系统主机名:</td><td>{hostName}</td></tr>");

            builder.Append($"<tr><td>系统根目录地址:</td><td>{WebConfigUtils.PhysicalApplicationPath}</td></tr>");

            builder.Append($"<tr><td>系统程序目录地址:</td><td>{PathUtils.PhysicalSiteServerPath}</td></tr>");

            builder.Append($"<tr><td>计算机的网卡地址:</td><td>{ComputerUtils.GetMacAddress()}</td></tr>");

            builder.Append($"<tr><td>计算机的CPU标识:</td><td>{ComputerUtils.GetProcessorId()}</td></tr>");

            builder.Append($"<tr><td>计算机的硬盘序列号:</td><td>{ComputerUtils.GetColumnSerialNumber()}</td></tr>");

            builder.Append($"<tr><td>域名:</td><td>{PageUtils.GetHost()}</td></tr>");

            builder.Append($"<tr><td>访问IP:</td><td>{PageUtils.GetIpAddress()}</td></tr>");

            builder.Append($"<tr><td>.NET版本:</td><td>{Environment.Version}</td></tr>");

            builder.Append($"<tr><td>SiteServer 系统版本:</td><td>{AppManager.GetFullVersion()}</td></tr>");

            builder.Append(
                $"<tr><td>最近升级时间:</td><td>{DateUtils.GetDateAndTimeString(ConfigManager.Instance.UpdateDate)}</td></tr>");

            builder.Append(
                $"<tr><td>数据库类型:</td><td>{(WebConfigUtils.IsMySql ? "MySql" : "SqlServer")}</td></tr>");

            builder.Append(
                $"<tr><td>数据库名称:</td><td>{SqlUtils.GetDatabaseNameFormConnectionString(WebConfigUtils.ConnectionString)}</td></tr>");

            return(builder.ToString());
        }