Пример #1
0
        /// <summary>
        /// 获取当前系统常用参数
        /// </summary>
        /// <returns></returns>
        public static GeneralConfigInfo GetConfig()
        {
            string            configid = "generalconfig";
            GeneralConfigInfo config   = AppCtx.Cache.RetrieveObject <GeneralConfigInfo>(configid);

            if (config == null)
            {
                config = GeneralConfigFileManager.LoadConfig();
                AppCtx.Cache.AddObjectWithFileChange(configid, config, ConfigFile);
            }
            return(config);
        }
Пример #2
0
        public static GeneralConfigInfo GetConfig()
        {
            //string configid = "generalconfig";
            GeneralConfigInfo config = null;

            if (config == null)
            {
                config = GeneralConfigFileManager.LoadConfig();
            }

            return(config);
        }
Пример #3
0
        public static GeneralConfigInfo LoadConfig()
        {
            if (ConfigInfo != null)
            {
                m_fileoldchange = File.GetLastWriteTime(ConfigFilePath);
                ConfigInfo      = GeneralConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, m_configinfo, true);
            }
            else
            {
                filename = HttpContext.Current.Server.MapPath("~/Config/general.config");
                if (null == ConfigInfo)
                {
                    ConfigInfo = new GeneralConfigInfo();
                }
                if (!File.Exists(filename))
                {
                    SerializationHelper.Save(ConfigInfo, filename);
                }
                ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, m_configinfo, false);
            }

            return(ConfigInfo as GeneralConfigInfo);
        }