Go to
www.mentalis.org, and look for a project named IniReader in the
'useful classes' section. He has a complete set of managed wrappers around
the ini file access API. It's downloadable and free, if I recall correctly.
HTH,
Tom Dacon
Dacon Software Consulting
"Neil G" <(E-Mail Removed)> wrote in message
news:C689C8D8-AB54-43A5-A047-(E-Mail Removed)...
> Has any got GetPrivateProfileString to work in vb.net? I am upgrading from
VB6.
>
> Code snippet:
>
> Public 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
>
>
>
> Dim sBuf As String, lreturn As Long
> Dim strTemp As String
> Dim strTemp2 As String
> Dim lSize As Long
>
>
> strTemp = New String(CChar(" "), BufferLen)
> lSize = Len(strTemp)
>
> Try
> lreturn = GetPrivateProfileString(SectionName, KeyName,
strDef, strTemp, lSize, IniFile)