Regarde cet exemple trouvé dans l'apiguide
'Example by Robin (rbnwares@edsamail.com.ph)
'Note : Need one listbox named List1
Private Declare Function GetPrivateProfileSectionNames Lib "kernel32.dll" Alias "GetPrivateProfileSectionNamesA" (ByVal lpszReturnBuffer As String, ByVal nSize As Long, ByVal lpFileName As String) As Long Private Sub Form_Load() Dim szBuf As String, Length As Integer Dim SectionArr() As String, m As Integer szBuf = String$(255, 0) Length = GetPrivateProfileSectionNames(szBuf, 255, vbNullChar) szBuf = Left$(szBuf, Length) SectionArr = Split(szBuf, vbNullChar) For m = 0 To UBound(SectionArr) List1.AddItem SectionArr(m) Next m End Sub
---- Sevyc64 (alias Casy) ----<hr size="2" width="100%" /># LE PARTAGE EST NOTRE FORCE #
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
25 mars 2024 à 00:31
Length = GetPrivateProfileSectionNames(szBuf, 255, vbNullChar)
Le 3eme argument doit contenir le chemin du fichier
Length = GetPrivateProfileSectionNames(szBuf, 255, "C:\MonFichier.ini")