Option Explicit


Public Declare Function GetPrivateProfileString Lib "kernel32" _

    Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, _

    ByVal lpKeyName As Any, ByVal lpDefault As String, _

    ByVal lpReturnedString As String, ByVal nSize As Long, _

    ByVal lpFileName As String) As Long

    

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



Public Sub WriteINI(iName As String, iKeyName As String, iKeyValue As String
 _

            iFilePath As String)

    WritePrivateProfileString iName, iKeyName, iKeyValue, iFilePath

End Sub



Public Function ReadINI(iName As String, iKeyName As String, iFilePath As
String, _

            Optional iDefault As String = "Default") As String

    Dim Ret As String

    Dim NC As Long

    Ret = String(255, 0)

    NC = GetPrivateProfileString(iName, iKeyName, iDefault, Ret, 255, _

        iFilePath)

    If NC <> 0 Then Ret = Left$(Ret, NC)

    ReadINI = Ret

End Function

 

 

-------Original Message-------

 

From: [EMAIL PROTECTED]

Date: 06/02/04 10:25:32

To: [EMAIL PROTECTED]

Subject: [vbhelp] Ini file

 

Dear all,

I want to ask you how to create, read and update ini file (using VB)?

What is the syntax in VB? Could you help me please?

Thanks.

 

Regards,

Yurisca

 

 

 

 

------------------------ Yahoo! Groups Sponsor --------------------~-->

Yahoo! Domains - Claim yours for only $14.70

http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/k7folB/TM

--------------------------------------------------------------------~->

 

 

'// =======================================================

    Rules : http://ReliableAnswers.com/List/Rules.asp

    Home  : http://groups.yahoo.com/group/vbHelp/

    =======================================================

    Post  : [EMAIL PROTECTED]

    Join  : [EMAIL PROTECTED]

    Leave : [EMAIL PROTECTED]

'// =======================================================

 

Yahoo! Groups Links

 

 

 

 

 

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/k7folB/TM
--------------------------------------------------------------------~-> 


'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [EMAIL PROTECTED]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to