Всё, уже не надо. Вот ответ :
| Код | Private 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 Public Event ErrorDownload(FromPathName As String, ToPathName As String) Public Event DownloadComplete(FromPathName As String, ToPathName As String)
Public Function DownloadFile(FromPathName As String, ToPathName As String) If URLDownloadToFile(0, FromPathName, ToPathName, 0, 0) = 0 Then DownloadFile = True MsgBox " DownloadComplete " & FromPathName & " TO" & ToPathName Else DownloadFile = False MsgBox " ErrorDownload " & FromPathName & "TO " & ToPathName End If End Function
Private Sub Command1_Click() Call DownloadFile("http://vbnet.ru/subscribe/images/question.gif", "c:\1.gif") End Sub
| |