Créer un répertoire

Créer un répertoire

Messagepar Michael DELIQUE » 22 Juil 2005 à 18:05

Code : Tout sélectionner
Function CreateDirectory(wPath As String) As Integer
   
   'Déclaration des Variables   
   Dim Directoty As String
   Dim i As Long
   Dim J As Long
   
   On Error Goto ErreurCreateDirectory
   
   If Trim(wPath)="'" Then
      Exit Function
   End If
   
   If Right(Trim(wPath),1)<>"\" Then
      wPath =Trim(wPath)+"\"
   End If
   
   On Error Resume Next
   
   i = 4
   J = 0
   While i <= Len(wPath)
      If Mid(wPAth,i,1)="\" Then
         Directoty= Left(wPath,i)
         Mkdir Directoty
         J=i
      Else
         j=j+1
      End If
      i=i+1
   Wend
   
   Exit Function
ErreurCreateDirectory:
   Msgbox "(CreateDirectory) Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   Exit Function
   
End Function
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy

Retour vers Dossier