BitServer.INI.getSections C# (CSharp) Method

getSections() public static method

public static getSections ( string Filename ) : string[]
Filename string
return string[]
        public static string[] getSections(string Filename)
        {
            if (File.Exists(Filename))
            {
                string[] Lines = File.ReadAllLines(Filename);
                List<string> sections = new List<string>();
                foreach (string line in Lines)
                {
                    if (line.Length > 0 && !line.StartsWith(";"))
                    {
                        if (line.StartsWith("[") && line.EndsWith("]"))
                        {
                            sections.Add(line.Substring(1, line.Length - 2));
                        }
                    }
                }
                return sections.ToArray();
            }
            return null;
        }