VbStudent302
Member
- Joined
- Oct 27, 2004
- Messages
- 7
I have been trying to get this function that reads from .ini files in VB 6.0 to work in VB .net.
Public Function ReadINI(ByVal INISection As String, ByVal INIKey As String, ByVal INIFile As String) As String
Dim StringBuffer As String
Dim StringBufferSize As Long
StringBuffer = ""
StringBuffer = StringBuffer.PadLeft(2000)
StringBufferSize = Len(StringBuffer)
StringBufferSize = GetPrivateProfileString(INISection, INIKey, "", StringBuffer, StringBufferSize, INIFile)
If StringBufferSize > 0 Then
ReadINI = LeftS(StringBuffer, StringBufferSize)
Else
ReadINI = ""
End If
End Function
I have got the writeIni function to work and i tried to change the "Left$(" to "microsoft.visualbasic.Left" but to no avail the code doesnt seem to work.
Any help would be greatly aprreciated. and im sorry if this is in the wrong thread i didnt know where to put it.
Public Function ReadINI(ByVal INISection As String, ByVal INIKey As String, ByVal INIFile As String) As String
Dim StringBuffer As String
Dim StringBufferSize As Long
StringBuffer = ""
StringBuffer = StringBuffer.PadLeft(2000)
StringBufferSize = Len(StringBuffer)
StringBufferSize = GetPrivateProfileString(INISection, INIKey, "", StringBuffer, StringBufferSize, INIFile)
If StringBufferSize > 0 Then
ReadINI = LeftS(StringBuffer, StringBufferSize)
Else
ReadINI = ""
End If
End Function
I have got the writeIni function to work and i tried to change the "Left$(" to "microsoft.visualbasic.Left" but to no avail the code doesnt seem to work.
Any help would be greatly aprreciated. and im sorry if this is in the wrong thread i didnt know where to put it.