Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate listfiles() As String Private countaudio As Integer Private countaudionombre As Integer Private Sub AnalizeDirectory() Dim iter As Integer Dim numeric As Boolean Dim filechar As Integer Dim result As Double Dim pathdirectory As String 'pathdirectory : le path du répertoir à analyser pathdirectory = "E:\ReadFile" Dim di As New IO.DirectoryInfo(pathdirectory) Dim aryFi As IO.FileInfo() aryFi = di.GetFiles() Dim fi As IO.FileInfo iter = 0 countaudio = 0 countaudionombre = 0 ReDim listfiles(iter) For Each fi In aryFi ' il y a encore des extension pour les audio file donc il faut les ajouter If fi.Extension ".wav" Or fi.Extension ".mdi" Then countaudio = countaudio + 1 numeric = False filechar = 0 'verifie s'il y a un chiffre dans le filename While Not numeric And filechar < fi.Name.Length If Double.TryParse(fi.Name.Substring(filechar, 1), result) Then numeric = True Else filechar = filechar + 1 End If End While If numeric Then countaudionombre = countaudionombre + 1 End If ReDim Preserve listfiles(iter) listfiles(iter) = fi.FullName iter = iter + 1 End If Next End Sub