Exemplo n.º 1
0
        /// <summary>
        /// 读取指定section下的Key值和Value值,返回资源词典Dictionary类型 Key,Value
        /// </summary>
        /// <param name="iniFile">Ini文件</param>
        /// <param name="section">节点名称</param>
        /// <returns></returns>
        public static Dictionary <string, string> INIGetDicValues(string iniFile, string section)
        {
            string[] allItems = INIOperation.INIGetAllItems(iniFile, section);
            string[] keys     = INIOperation.INIGetAllItemKeys(iniFile, section);
            Dictionary <string, string> values = new Dictionary <string, string>();

            for (int i = 0; i < keys.Length; i++)
            {
                values.Add(keys[i], INIGetStringValue(iniFile, section, keys[i], ""));
            }
            return(values);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 读取指定section下的Key值和Value值,返回一个List数组,List[][]
        /// </summary>
        /// <param name="iniFile"></param>
        /// <param name="section"></param>
        /// <returns></returns>
        public static List <string[]> INIGetListValues(string iniFile, string section)
        {
            string[]        allItems = INIOperation.INIGetAllItems(iniFile, section);
            string[]        keys     = INIOperation.INIGetAllItemKeys(iniFile, section);
            List <string[]> values   = new List <string[]>();

            for (int i = 0; i < keys.Length; i++)
            {
                values.Add(new string[] { keys[i], INIGetStringValue(iniFile, section, keys[i], "") });
            }
            return(values);
        }