Comment lire et ecrire dans .ini

Gestmed Messages postés 4 Date d'inscription lundi 8 avril 2002 Statut Membre Dernière intervention 8 mai 2009 - 19 juin 2002 à 12:57
BasicInstinct Messages postés 1470 Date d'inscription mardi 5 février 2002 Statut Membre Dernière intervention 20 octobre 2014 - 19 juin 2002 à 18:04
Je sais que ma question est stupide ?
Merci d'y rpondre quand mme
Stef

1 réponse

BasicInstinct Messages postés 1470 Date d'inscription mardi 5 février 2002 Statut Membre Dernière intervention 20 octobre 2014 12
19 juin 2002 à 18:04
c clair que ta question est stupide !

reponse 1 :
y'a des sources qui le font sur le site !

reponse 2 :

Private 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

Private 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

Function LireINI(Entete As String, Variable As String) As String
Dim Retour As String
Fichier = App.Path & "" & App.EXEName & ".ini"
Retour = String(255, Chr(0))
LireINI = Left$(Retour, GetPrivateProfileString(Entete, ByVal Variable, "", Retour, Len(Retour), Fichier))
End Function

Function EcrireINI(Entete As String, Variable As String, Valeur As String) As String
Fichier = App.Path & "" & App.EXEName & ".ini"
WriteINI = WritePrivateProfileString(Entete, Variable, Valeur, Fichier)
End Function

(source de Nix)
0
Rejoignez-nous