/ Published in: VB.NET

list files from directory and subdirectory into a table
'On déclare une arraylist qui contiendra tous les fichiers
'On déclare une arraylist qui contiendra tous les fichiers
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Private ListeInfo As New ArrayList ' La fonction qui va remplir notre arraylist Private function ListeFichier(ByVal repertoire As DirectoryInfo, ByVal Reset As Boolean) as arraylist If Reset = True Then ListeInfo.Clear() End If If repertoire.GetDirectories.Length <> 0 Then For Each repertoire2 As DirectoryInfo In repertoire.GetDirectories ListeFichier(repertoire2, False) Next End If For Each fichier As FileInfo In repertoire.GetFiles("*.*") ListeInfo.Add(fichier.Name) Next return ListeInfo End function 'Pour appeler la fonction on fait ListeFichier("C:/",true) 'Le booleen en parametre veut dire qu'on efface tout ce qu'il y a déjà dans l'arraylist
Comments
