G
Guest
I know, I know. INI files are officially bad now. Regardless, I have a
question about the GetPrivateProfileSectionNames function in vb.net.
When I call the function, I am only getting the first section of the INI
file, not all the sections. I can't figure out why (yes, the INI file has
more than one section).
Thanks in advance,
PJSimon
************************
Private Declare Ansi Function GetPrivateProfileSectionNames Lib
"kernel32.dll" _
Alias "GetPrivateProfileSectionNamesA" _
(ByVal lpReturnedString As StringBuilder, _
ByVal nSize As Integer, _
ByVal lpFileName As String) As Integer
Public Const PS_SIZE = 2000
Public Function GetINISectionNames(ByVal sIniFile As String) As String
Dim sProfileStringBuilder As New StringBuilder(PS_SIZE)
Dim sProfileString As String
Dim iRc As Integer
sProfileString = Space(PS_SIZE)
iRc = GetPrivateProfileSectionNames(sProfileStringBuilder, _
sProfileStringBuilder.Capacity, sIniFile)
sProfileString = sProfileStringBuilder.ToString
GetINISectionNames = sProfileString
End Function
question about the GetPrivateProfileSectionNames function in vb.net.
When I call the function, I am only getting the first section of the INI
file, not all the sections. I can't figure out why (yes, the INI file has
more than one section).
Thanks in advance,
PJSimon
************************
Private Declare Ansi Function GetPrivateProfileSectionNames Lib
"kernel32.dll" _
Alias "GetPrivateProfileSectionNamesA" _
(ByVal lpReturnedString As StringBuilder, _
ByVal nSize As Integer, _
ByVal lpFileName As String) As Integer
Public Const PS_SIZE = 2000
Public Function GetINISectionNames(ByVal sIniFile As String) As String
Dim sProfileStringBuilder As New StringBuilder(PS_SIZE)
Dim sProfileString As String
Dim iRc As Integer
sProfileString = Space(PS_SIZE)
iRc = GetPrivateProfileSectionNames(sProfileStringBuilder, _
sProfileStringBuilder.Capacity, sIniFile)
sProfileString = sProfileStringBuilder.ToString
GetINISectionNames = sProfileString
End Function