Sprache: VB
INI Wert schreiben
Private Declare Ansi Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" ( _
ByVal lpApplicationName As String, _
ByVal lpKeyName As String, _
ByVal lpString As String, _
ByVal lpFileName As String) _
As Integer
Public Sub SetINIString(ByVal INIFile As String, ByVal Section As String, ByVal Key As String, ByVal Value As String)
WritePrivateProfileString(Section, Key, Value, INIFile)
End Sub
Private Declare Ansi Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" ( _
ByVal lpApplicationName As String, _
ByVal lpKeyName As String, _
ByVal lpString As String, _
ByVal lpFileName As String) _
As Integer
Public Sub SetINIString(ByVal INIFile As String, ByVal Section As String, ByVal Key As String, ByVal Value As String)
WritePrivateProfileString(Section, Key, Value, INIFile)
End Sub
Alte URL:
/snippet/ini-wert-schreiben/89
I did not know that this is possible in that simple way. I think the filename has to be between CHR(34) character. example: C:program filestest.ini, will not work but „C:program filestest.ini“ will.