AutoQuery.Systems.Ini.GetEntryNames C# (CSharp) Метод

GetEntryNames() публичный Метод

Retrieves the names of all the entries inside a section.
/// is null or empty.
public GetEntryNames ( string section ) : string[]
section string /// The name of the section holding the entries.
Результат string[]
            public override string[] GetEntryNames(string section)
            {
                // Verify the section exists
                if (!HasSection(section))
                    return null;

                VerifyAndAdjustSection(ref section);

                // Loop until the buffer has grown enough to fit the value
                for (int maxSize = 500; true; maxSize *= 2)
                {
                    byte[] bytes = new byte[maxSize];
                    int size = GetPrivateProfileString(section, 0, "", bytes, maxSize, Name);

                    if (size < maxSize - 2)
                    {
                        // Convert the buffer to a string and split it
                        string entries = Encoding.ASCII.GetString(bytes, 0, size - (size > 0 ? 1 : 0));
                        if (entries == "")
                            return new string[0];
                        return entries.Split(new char[] { '\0' });
                    }
                }
            }