Ca me parait bien compliqué et pas très optimisé.
Une ligne de code suffit pour tester l'existence d'un fichier:
Function FileExist(FullpathName As String) As Boolean
On Error GoTo GestionErr
'--------------------------
If Dir(FullpathName) <> "" Then FileExist = True
GestionErr:
End Function
Renfield
Messages postés17287Date d'inscriptionmercredi 2 janvier 2002StatutModérateurDernière intervention27 septembre 202174 10 déc. 2004 à 13:19
via API :
If GetFileAttributes(szfile) And &H80000000& Then ABSENT
crenaud76
Messages postés4172Date d'inscriptionmercredi 30 juillet 2003StatutMembreDernière intervention 9 juin 200628 10 déc. 2004 à 11:34
Ta boucle While ... Wend pour avoir le dernier '\' peut être remplacer par une simple instruction InstrRev si tu es en VB6 !
11 déc. 2004 à 15:11
11 déc. 2004 à 14:58
Une ligne de code suffit pour tester l'existence d'un fichier:
Function FileExist(FullpathName As String) As Boolean
On Error GoTo GestionErr
'--------------------------
If Dir(FullpathName) <> "" Then FileExist = True
GestionErr:
End Function
10 déc. 2004 à 13:19
If GetFileAttributes(szfile) And &H80000000& Then ABSENT
10 déc. 2004 à 11:34