1
2
3
4
5
6
7
8
9
10
11
12
|
Private Declare Ansi Function GetPrivateProfileSectionNames Lib "kernel32" Alias "GetPrivateProfileSectionNamesA" ( _
ByVal lpszReturnBuffer() As Byte, _
ByVal nSize As Integer, ByVal _
lpFileName As String) _
As Integer
Public Function GetSectionNames(ByVal INIFile As String) As String()
Dim Buffer(32768) As Byte
GetPrivateProfileSectionNames(Buffer, 32768, INIFile)
Dim Sections() As String = System.Text.Encoding.ASCII.GetString(Buffer).Trim(ControlChars.NullChar).Split(ControlChars.NullChar)
Return Sections
End Function
|