Example #1
0
        private void LoadConfig()
        {
            Name                = WebConfigurationManager.AppSettings["Name"];
            Title               = WebConfigurationManager.AppSettings["Title"];
            Description         = WebConfigurationManager.AppSettings["Description"];
            Footer              = WebConfigurationManager.AppSettings["Footer"];
            ModulePath          = WebConfigurationManager.AppSettings["ModulePath"];
            ConfigurationPath   = WebConfigurationManager.AppSettings["ConfigurationPath"];
            DatabaseType        = WebConfigurationManager.AppSettings["DatabaseType"];
            DatabasePath        = WebConfigurationManager.AppSettings["DatabasePath"];
            RegistrationKeyPath = WebConfigurationManager.AppSettings["RegistrationKeyPath"];

#if DEBUG
            // For debugging, change the path to the App_Data folder, where the
            // test files and databases are stored.
            ModulePath          = HttpContext.Current.Server.MapPath(ModulePath);
            ConfigurationPath   = HttpContext.Current.Server.MapPath(ConfigurationPath);
            DatabaseType        = "ESENT";
            DatabasePath        = HttpContext.Current.Server.MapPath(DatabasePath);
            RegistrationKeyPath = HttpContext.Current.Server.MapPath(RegistrationKeyPath);
#endif

            // Trim path
            ModulePath          = ModulePath.TrimEnd(new char[] { '\\', '/' });
            ConfigurationPath   = ConfigurationPath.TrimEnd(new char[] { '\\', '/' });
            DatabasePath        = DatabasePath.TrimEnd(new char[] { '\\', '/' });
            RegistrationKeyPath = RegistrationKeyPath.TrimEnd(new char[] { '\\', '/' });

            VerifyConfig();
        }