bonjour tout le monde,
jai renomme des fichiers et je voudrait les deplacer dans un autre repertoire chose que j'arrive pas a faire.
ca renvoi un message d'erreur:
Une exception non gérée du type 'System.ArgumentNullException' s'est produite dans mscorlib.dll

Informations supplémentaires*: Le nom de fichier ne peut pas être null.
voila mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
Dim j As Integer
        Dim Fil() As String
        Dim chemin As String
        Dim fic As String
        Dim ficMode As String
        Dim rep As String
 
        chemin = "\\phsite\c$\TRSFUNIX\_mail\jack"
        Fil = Directory.GetFiles(chemin)
        For j = 0 To Fil.GetUpperBound(0)
            fic = Fil(j).Substring(chemin.Length + 1)
            'MsgBox(fic)
            If InStr(Fil(j), ".txt") > 0 Then
                If fic.Substring(0, 2) = "ma" Or fic.Substring(0, 2) = "po" Then
                    ficMode = fic.Substring(3, 8) & "_" + fic.Substring(0, 2) & ".wri"
                    File.Move(ficMode, rep)
 
                    ' MsgBox(ficMode)
                End If
 
            End If
 
        Next
Merci