Beispiel #1
0
        /// <summary>
        /// 将配置文件App.config里的AppSetting配置信息注入到全局变量中供应用使用
        /// </summary>
        private static void initAppSettings(char AppType = EnumAppType.Web)
        {
            Configuration config = AppConfig.Instance().getCurrentConfig(AppType);

            // Get the KeyValueConfigurationCollection from the configuration.
            KeyValueConfigurationCollection settings = config.AppSettings.Settings;
            Hashtable data = new Hashtable();

            foreach (KeyValueConfigurationElement keyValueElement in settings)
            {
                data.Add(keyValueElement.Key, keyValueElement.Value);
            }
            UtilReflection.SetPublicStaticProperties(typeof(Gc), data);
            UtilReflection.IsDebug = Gc.IsDebug;
        }