Ejemplo n.º 1
0
        public override DataBaseInfo GetDataBaseInfo()
        {
            string version = "";

            using (SqlQuery query = new SqlQuery())
            {
                query.CommandText = "SELECT size*8,(status & 0x40) as type FROM sysfiles;SELECT @@VERSION";
                DataBaseInfo dataBaseInfo = new DataBaseInfo();
                using (XSqlDataReader reader = query.ExecuteReader())
                {
                    int dataSize = 0;
                    int logoSize = 0;
                    while (reader.Read())
                    {
                        if (reader.GetInt32(1) == 0)
                            dataSize += reader.GetInt32(0);
                        else
                            logoSize += reader.GetInt32(0);
                    }
                    if (reader.NextResult())
                    {
                        while (reader.Read())
                            version += "(" + reader.GetString(0) + ")";
                    }
                    dataBaseInfo.DataSize = dataSize * 1024;
                    dataBaseInfo.LogSize = logoSize * 1024;
                    dataBaseInfo.Version = version;
                }
                return dataBaseInfo;
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WaitForFillSimpleUsers<ConsoleLoginLog>(ConsoleLog);

            OSVersion = Environment.OSVersion.ToString();
            if (OSVersion.IndexOf("Microsoft Windows NT 5.0") > -1)
            {
                OSVersion = string.Concat("Microsoft Windows 2000 (", OSVersion, ")");
                IISVersion = "IIS 5";
            }
            else if (OSVersion.IndexOf("Microsoft Windows NT 5.1") > -1)
            {
                OSVersion = string.Concat("Microsoft Windows XP (", OSVersion, ")");
                IISVersion = "IIS 5.1";
            }
            else if (OSVersion.IndexOf("Microsoft Windows NT 5.2") > -1)
            {
                OSVersion = string.Concat("Microsoft Windows 2003 (", OSVersion, ")");
                IISVersion = "IIS 6";
            }
            else if (OSVersion.IndexOf("Microsoft Windows NT 6.0") > -1)
            {
                OSVersion = string.Concat("Microsoft Windows Vista (", OSVersion, ")");
                IISVersion = "IIS 7";
            }
            else if (OSVersion.IndexOf("Microsoft Windows NT 6.1") > -1)
            {
                OSVersion = string.Concat("Microsoft Windows 7 (", OSVersion, ")");
                IISVersion = "IIS 7.5";
            }

            NETVersion = Environment.Version.ToString();

                dataBaseInfo = DataAccess.DatabaseInfoDao.Instance.GetDataBaseInfo();
    
            try
            {
                memoryInfo = new MemoryInfo().GetMemoryInfo();
            }
            catch
            {
                memoryInfo = new MemoryInfo();
            }
        }