Ftp download fichier txt

cs_zapad Messages postés 70 Date d'inscription mercredi 30 avril 2003 Statut Membre Dernière intervention 7 juillet 2009 - 10 déc. 2008 à 17:29
cs_zapad Messages postés 70 Date d'inscription mercredi 30 avril 2003 Statut Membre Dernière intervention 7 juillet 2009 - 10 déc. 2008 à 18:58
bonjour
je cherche a recuperer un fichier texte sur le net

ex
ftp://tgftp.nws.noaa.gov/data/observations/metar/stations/LFDB.TXT

pour l instant ca marche dans ma fenetre explorateur MSIE

mais quelle est la syntaxe sur VB6  ; vu qu'il n y a ni login ni password
pour obtenir ces datas
merci

1 réponse

cs_zapad Messages postés 70 Date d'inscription mercredi 30 avril 2003 Statut Membre Dernière intervention 7 juillet 2009
10 déc. 2008 à 18:58
'encore moi
'j ai essayé ce qui suit
'mais pas de fichier a l arrivée
'==================================
Option Explicit
'============================================
'=========   Recup internet     ====== --------------   9
'============================================

'--------------------------------------
     Private Sub Command1_Click()
    
     Dim taille, pourcent As Integer
     Dim fic_source, fic_destination As String
    
     fic_source = "LFDB.TXT" 'fichier a telecharger
     fic_destination = App.Path & "" & "metar.txt"  'fichier de destination
    
     With Inet
     .Protocol = icFTP 'declaration protocole
     .URL = "ftp://tgftp.nws.noaa.gov/data/observations/metar/stations/" 'le ftp
     End With
    
    
     Do Until Inet.StillExecuting = False 'boucle pendant le traitement de inet
     DoEvents
     Loop

     'telechargement du fichier
     Inet.Execute , "get " & fic_source & " " & fic_destination
    
     Do Until Inet.StillExecuting = True 'boucle pendant le traitement de inet
     On Error Resume Next
     DoEvents
     
     Loop
     Text2.Text = "ok"
     End Sub
0
Rejoignez-nous