Example #1
0
        /// <summary>
        /// Returns the environment data as json.
        /// </summary>
        /// <returns>a JSON formatted string</returns>
        private string GetEnvDataAsJson()
        {
            string sqlVersion = "";

            try
            {
                sqlVersion = Rock.Data.DbService.ExecuteScaler("SELECT SERVERPROPERTY('productversion')").ToString();
            }
            catch
            {
                // oh well, sorry, I have to move on...
            }

            EnvData envData = new EnvData()
            {
                AppRoot       = ResolveRockUrl("~/"),
                Architecture  = (IntPtr.Size == 4) ? "32bit" : "64bit",
                AspNetVersion = Environment.Version.ToString(),
                IisVersion    = Request.ServerVariables["SERVER_SOFTWARE"],
                //Ram = new Microsoft.VisualBasic.Devices.ComputerInfo().TotalPhysicalMemory,
                ServerOs   = Environment.OSVersion.ToString(),
                SqlVersion = sqlVersion
            };

            return(envData.ToJson());
        }
Example #2
0
        /// <summary>
        /// Returns the environment data as json.
        /// </summary>
        /// <returns>a JSON formatted string</returns>
        private string GetEnvDataAsJson()
        {
            string sqlVersion = "";
            try
            {
                sqlVersion = Rock.Data.DbService.ExecuteScaler( "SELECT SERVERPROPERTY('productversion')" ).ToString();
            }
            catch
            {
                // oh well, sorry, I have to move on...
            }

            EnvData envData = new EnvData()
            {
                AppRoot = ResolveRockUrl( "~/" ),
                Architecture = (IntPtr.Size == 4) ? "32bit" : "64bit",
                AspNetVersion = Environment.Version.ToString(),
                IisVersion = Request.ServerVariables["SERVER_SOFTWARE"],
                //Ram = new Microsoft.VisualBasic.Devices.ComputerInfo().TotalPhysicalMemory,
                ServerOs = Environment.OSVersion.ToString(),
                SqlVersion = sqlVersion
            };

            return envData.ToJson();
        }