 |
Lycaon Level: Guest

|
Re: Download a File
Try this. No progress or anything but it does everything seamlessly and simply.
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 Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Private Sub Form_Load()
DownloadFile "http://www.allapi.net", "c:\allapi.htm"
End Sub |
I'm pretty sure this is a synchronous download, so I wouldn't go about downloading a huge file with it or anything. A custom class utilizing winsock would be handy.
|
|
29-06-2004 at 06:18 PM |
|
|  |
|
|
|
|
 |
 |