コード例 #1
0
ファイル: IniParser.cs プロジェクト: vexi0nline/RinaClient
        // Token: 0x06000062 RID: 98 RVA: 0x00005DA0 File Offset: 0x00005DA0
        public string[] EnumSection(string sectionName)
        {
            ArrayList arrayList = new ArrayList();

            foreach (object obj in this.keyPairs.Keys)
            {
                IniParser.SectionPair sectionPair = (IniParser.SectionPair)obj;
                if (sectionPair.Section == sectionName.ToUpper())
                {
                    arrayList.Add(sectionPair.Key);
                }
            }
            return((string[])arrayList.ToArray(typeof(string)));
        }
コード例 #2
0
ファイル: IniParser.cs プロジェクト: vexi0nline/RinaClient
        // Token: 0x06000066 RID: 102 RVA: 0x00005EE0 File Offset: 0x00005EE0
        public void SaveSettings(string newFilePath)
        {
            ArrayList arrayList = new ArrayList();
            string    text      = "";

            foreach (object obj in this.keyPairs.Keys)
            {
                IniParser.SectionPair sectionPair = (IniParser.SectionPair)obj;
                if (!arrayList.Contains(sectionPair.Section))
                {
                    arrayList.Add(sectionPair.Section);
                }
            }
            foreach (object obj2 in arrayList)
            {
                string text2 = (string)obj2;
                text = text + "[" + text2 + "]\r\n";
                foreach (object obj3 in this.keyPairs.Keys)
                {
                    IniParser.SectionPair sectionPair2 = (IniParser.SectionPair)obj3;
                    if (sectionPair2.Section == text2)
                    {
                        string text3 = (string)this.keyPairs[sectionPair2];
                        if (text3 != null)
                        {
                            text3 = "=" + text3;
                        }
                        text = text + sectionPair2.Key + text3 + "\r\n";
                    }
                }
                text += "\r\n";
            }
            try
            {
                StreamWriter streamWriter = new StreamWriter(newFilePath);
                streamWriter.Write(text);
                streamWriter.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }