|
|
Закачка файла по URL (API)
Private Declare PtrSafe 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 URLDownLoadOneFile(sFileURL As String, sLocalFilePath As String) As Boolean
On Error GoTo URLDownLoadOneFile_Err
URLDownLoadOneFile = URLDownloadToFile(0, sFileURL, sLocalFilePath, 0, 0) = 0
URLDownLoadOneFile_Bye:
Exit Function
URLDownLoadOneFile_Err:
Resume URLDownLoadOneFile_Bye
End Function
Пример эксплуатации:
Private Sub URLDownLoadTest()
Debug.Print URLDownLoadOneFile("http://msa.polarcom.ru/st/s0000061_Connection_Example_v01.zip", _
"D:\temp\Connection_Example_v01.zip")
End Sub
|
|