VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Read/Write Easy INI Example

by Matthew Gates (16 Submissions)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Fri 25th February 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Read/Write Easy INI Example

API Declarations


Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long

Rate Read/Write Easy INI Example



'''''''''''''''''''''''''''''''''''''''''''''''''''''''
'read ini                                             '
'x = readini("Example INI", "Example", "C:\Example.ini")'
'MsgBox X                                             '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
   Dim strbuffer As String
   Let strbuffer$ = String$(750, Chr$(0&))
   Let readini$ = Left$(strbuffer$, GetPrivateProfileString(strsection$, ByVal LCase$(strkey$), "", strbuffer, Len(strbuffer), strfullpath$))
End Function

Public Sub WriteINI(strsection As String, strkey As String, strkeyvalue As String, strfullpath As String)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'write ini                                                       '
'Call writeini("Example INI", "Example", "Yes", "C:\Example.ini")'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Call WritePrivateProfileString(strsection$, UCase$(strkey$), strkeyvalue$, strfullpath$)
End Sub

Download this snippet    Add to My Saved Code

Read/Write Easy INI Example Comments

No comments have been posted about Read/Write Easy INI Example. Why not be the first to post a comment about Read/Write Easy INI Example.

Post your comment

Subject:
Message:
0/1000 characters