Beispiel #1
0
        /// <summary>
        /// 设置配置文件
        /// </summary>
        /// <param name="key">key</param>
        /// <param name="val">val</param>
        public static int SetValByKey(string key, object val)
        {
            GloVar en = new GloVar(key, val);

            en.ValOfObject = val;
            return(en.Update());
        }
Beispiel #2
0
        public static float GetValByKeyFloat(string key, float isNullAs)
        {
            foreach (GloVar cfg in GloVars.MyGloVars)
            {
                if (cfg.No == key)
                {
                    return(cfg.ValOfFloat);
                }
            }

            GloVar en = new GloVar(key, isNullAs);

            return(en.ValOfFloat);
        }
Beispiel #3
0
        public static int GetValByKeyDecimal(string key, int isNullAs)
        {
            foreach (GloVar cfg in GloVars.MyGloVars)
            {
                if (cfg.No == key)
                {
                    return(cfg.ValOfInt);
                }
            }

            GloVar en = new GloVar(key, isNullAs);

            //GloVar en = new GloVar(key);
            return(en.ValOfInt);
        }
Beispiel #4
0
        /// <summary>
        /// 得到,一个key.
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string GetValByKey(string key, string isNullAs)
        {
            foreach (GloVar cfg in GloVars.MyGloVars)
            {
                if (cfg.No == key)
                {
                    return(cfg.Val);
                }
            }

            GloVar en = new GloVar(key, isNullAs);

            //GloVar en = new GloVar(key);
            return(en.Val);
        }
Beispiel #5
0
        public static bool GetValByKeyBoolen(string key, bool isNullAs)
        {
            foreach (GloVar cfg in GloVars.MyGloVars)
            {
                if (cfg.No == key)
                {
                    return(cfg.ValOfBoolen);
                }
            }


            int val = 0;

            if (isNullAs)
            {
                val = 1;
            }

            GloVar en = new GloVar(key, val);

            return(en.ValOfBoolen);
        }