Feedback

VB - INI Wert lesen

Veröffentlicht von am 03.06.2006
(3 Bewertungen)
Den INI Wert aus einer INI Datei auslesen
Private Declare Ansi 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 Integer, _
    ByVal lpFileName As String) _
As Integer

Public Function GetINIString(ByVal INIFile As String, ByVal Section As String, ByVal Key As String, Optional ByVal DefaultValue As String = "", Optional ByVal BufferSize As Integer = 1024) As String
    Dim sTemp As String = Space(BufferSize)
    Dim Length As Integer = GetPrivateProfileString(Section, Key, DefaultValue, sTemp, BufferSize, INIFile)
    Return Left(sTemp, Length)
End Function
Abgelegt unter INI.

Kommentare zum Snippet

 

Logge dich ein, um hier zu kommentieren!