1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| Imports System.IO
Public Class Scanner
Dim emplacement As String
Public Sub scanner(ByVal emplacement As String)
Dim FolderL As New IO.DirectoryInfo(emplacement)
Dim L As Integer
L = 0
For Each fichier As FileInfo In FolderL.GetFiles("*.*") ' a mon avis c'est pas correct ici
L = L + 1
Next
L = L - 1
Dim tableau(L, 3) As String
Dim j As Integer
j = 0
For Each fichier As FileInfo In FolderL.GetFiles("*.*")
tableau(j, 0) = fichier.Name
tableau(j, 1) = fichier.Length
tableau(j, 3) = 1
j = j + 1
Next
Do While Form1.bscan = True
For Each fichier As FileInfo In FolderL.GetFiles("*.*")
For i = 0 To L - 1
If tableau(i, 0) = fichier.Name Then
If fichier.Length = tableau(i, 1) Then
[COLOR="rgb(0, 100, 0)"]tableau(i, 3) = 0[/COLOR] 'un peu trop brutale ?
End If
End If
Next
Next
For i = 0 To L - 1
If tableau(i, 3) = 1 Then
Ajoutermodfi(tableau(i, 0))
End If
Next
L = 0
For Each fichier As FileInfo In FolderL.GetFiles("*.*")
L = L + 1
Next
L = L - 1
ReDim tableau(L, 3)
j = 0
For Each fichier As FileInfo In FolderL.GetFiles("*.*")
tableau(j, 0) = fichier.Name
tableau(j, 1) = fichier.Length
tableau(j, 3) = 0
j = j + 1
Next
Delay(5)
Loop
End Sub |
Partager