Private Sub Command1_Click() 'enregistrement du contenu la filelistbox dans un fichier Open App.Path & "/fichier.txt" For Output As #1 For i = 0 To File1.ListCount - 1 Write #1, File1.List(i) Next i Close #1 End Sub Private Sub Command2_Click() 'ouverture et stockage des fichiers dans un tableau Dim TabFic() As String, X As Integer Open App.Path & "/fichier.txt" For Input As #1 Do While Not EOF(1) ReDim Preserve TabFic(X) Input #1, TabFic(X) X = X + 1 Loop Close #1 'comparaison Dim Existe As Boolean Existe = False For i = 0 To File1.ListCount - 1 For a = 0 To UBound(TabFic) If File1.List(i) TabFic(a) Then Existe True: Exit For Next a If Existe Then MsgBox File1.List(i) & " Existe dans le fichier" Else _ MsgBox File1.List(i) & " n'existe pas dans le fichier" Existe = False Next i End Sub
Private Sub Command1_Click() 'enregistrement du contenu la filelistbox dans un fichier Open App.Path & "/fichier.txt" For Output As #1 For i = 0 To File1.ListCount - 1 Write #1, File1.List(i) Next i Close #1 End Sub Private Sub Command2_Click() 'ouverture et stockage des fichiers dans un tableau Dim TabFic() As String, X As Integer Open App.Path & "/fichier.txt" For Input As #1 Do While Not EOF(1) ReDim Preserve TabFic(X) Input #1, TabFic(X) X = X + 1 Loop Close #1 'comparaison Dim Existe As Boolean Existe = False For i = 0 To File1.ListCount - 1 For a = 0 To UBound(TabFic) If File1.List(i) TabFic(a) Then Existe True: Exit For Next a If Existe Then MsgBox File1.List(i) & " Existe dans le fichier" Else _ MsgBox File1.List(i) & " n'existe pas dans le fichier" Next i End Sub