1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
Dim HwndConnect As Long
Dim HwndOpen As Long
'Ouvre internet
HwndOpen = InternetOpen("www.google.fr", 0, vbNullString, vbNullString, 0)
MsgBox HwndOpen
'Connection au site ftp
HwndConnect = InternetConnect(HwndOpen, ftp://xxx.xxx.xxx.xxx, 21, "anonymous", "nom-prenom", 1, 0, 0)
MsgBox HwndConnect
'positionnement du curseur dans le répertoire
FtpSetCurrentDirectory HwndConnect, "Rep1/Rep2"
'Téléchargement
FtpGetFile HwndConnect, "Fichier1", "P:\Fichier2", _
False, 0, &H0, 0
InternetCloseHandle HwndConnect 'Ferme la connection
InternetCloseHandle HwndOpen 'Ferme internet
End Sub |
Partager