Здравствуйте, Dima Sokolets, Вы писали:
DS>Может кто знает как средствами VB 6.0 сделать download файла на локальный computer.
DS>например есть линк: http://sitename/files/text.txt
DS>надо через VB 6.0 загрузить file text.txt и сохранить его на лоkальном computer.
Где-то в свое время списала, вроде работает
Public 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 bDownLoadFile(strURL As String, strFileName As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, strURL, strFileName, 0, 0)
If lngRetVal = 0 Then
bDownLoadFile = True
End If
Exit Function
errHandler:
Debug.Print "Error Source:", Err.Source
Debug.Print "Error Description:", Err.Description
Debug.Print "Error Number:", Err.Number
MsgBox "An error has occured attempting to start download to " & strURL
bDownLoadFile = False
End Function
Вызываю
bDownLoadFile("http://sitename/files/text.txt, sПутьКЗагружаемымФайлам & "\text.txt")