Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szUrl As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long Function DownloadPage(ByVal url As String, ByVal FileName As String) As Boolean Dim done As Boolean Dim bon As Long ok = True If Dir$(FileName) <> "" Then Kill FileName End If bon = URLDownloadToFile(0, url, FileName, 0, 0) If Dir$(FileName) = "" Then ok = False End If DownloadPage = ok End Function Private Sub Command1_Click() Dim toto As Boolean Dim sURL As String Dim sFileName As String sURL = "http://www.youtube.com/watch?v=diAFCexxKfs" sFileName = "c:\test.txt" toto = DownloadPage(sURL, sFileName) If toto Then MsgBox "Téléchargement réussi." Else MsgBox "Erreur lors du télécharegement" End If End Sub