CodeTV.INIReader.GetEntry C# (CSharp) Method

GetEntry() public method

public GetEntry ( string section, string entryKey ) : string
section string
entryKey string
return string
        public string GetEntry(string section, string entryKey)
        {
            return GetEntry(section, entryKey, null);
        }

Same methods

INIReader::GetEntry ( string section, string entryKey, string defaultValue ) : string

Usage Example

        private static void ReadFile(StreamReader streamReader, string section, Dictionary <string, Dictionary <string, List <string> > > channels)
        {
            INIReader iniReader = new INIReader(streamReader);
            string    country   = iniReader.GetEntry(section, "1");

            if (country != null)
            {
                Dictionary <string, List <string> > regions;
                if (!channels.TryGetValue(country, out regions))
                {
                    channels[country] = regions = new Dictionary <string, List <string> >();
                }

                string region = iniReader.GetEntry(section, "2");
                if (region != null)
                {
                    List <string> frequencies;
                    if (!regions.TryGetValue(region, out frequencies))
                    {
                        regions[region] = frequencies = new List <string>();
                    }

                    string numberOfFrequencies = iniReader.GetEntry("DVB", "0");
                    if (numberOfFrequencies != null)
                    {
                        int count = int.Parse(numberOfFrequencies);
                        for (int i = 1; i <= count; i++)
                        {
                            frequencies.Add(iniReader.GetEntry("DVB", i.ToString()));
                        }
                    }
                }
            }
        }
All Usage Examples Of CodeTV.INIReader::GetEntry