V = GetPrivateProfileString(Se ction, Key, "", RetVal, 255, FileName) Public Function ReadIniData(ByVal Section As String, ByVal Key As String) As String Private FileName As String = App.Path & "\MyINI.ini" Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileString A" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Long Private Declare Function WritePrivateProfileSection Lib "kernel32" Alias "WritePrivateProfileSectio nA" (ByVal lpAppName As String, ByVal lpString As String, ByVal lpFileName 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 Private Declare Function GetPrivateProfileSection Lib "kernel32" Alias "GetPrivateProfileSectionA " (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long It writes the value with no problem, but just won't read the same value - it always returns "" (being the default string)! I am having a drawback using the GetPrivateProfileString() API in VB.NET.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |