Hello,
I'm trying to read an ini file with the API Call GetPrivateProfileString. The code below works in VB6, but not in VB.NET. Does anybody know why. Please let me know if u do!
Code: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 Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strRetString As String strRetString = " " Dim lngRetval As Long lngRetval = GetPrivateProfileString("SECTIONNAME", "KEYNAME", "Default Value", strRetString, Len(strRetString), "C:\AnIniFile.ini") End Sub




Reply With Quote