Hello,
I am using the following code to read/write information of a INF file.
Now, I need to Read all the Keys of a specific Section in the INF file..Code:Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyName As Any, ByVal lsString As Any, ByVal lplFilename As String) As Long Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long Public Function RD(Section As String, Key As String, strFileName As String) As String On Error Resume Next Dim lngResult As Long Dim strResult As String * 255 lngResult = GetPrivateProfileString(Section, Key, strFileName, strResult, Len(strResult), strFileName) RD = Trim$(strResult) End Function Public Function WD(Section As String, Key As String, Content As String, strFileName As String) On Error Resume Next Dim lngResult As Long lngResult = WritePrivateProfileString(Section, Key, Content, strFileName) End Function
For Example:
The INF data is something like:
[config]
DATA1=abcd
DATA2=efgh
DATA3=1234
I want to Read How many Keys (DATA1,DATA2...so on) are Present under "config" Section and want to load these keys data in a listbox..
Please help me to solveout this..
Thanks
Regards,




Reply With Quote