|
-
Oct 21st, 2000, 09:17 PM
#1
Thread Starter
Fanatic Member
If I want to download a file from the internet, What controls do I use and please post the code to use with them.
If I want to upload afile from the internet, What controls do I use and please post the code to use with them.
Visual Basic 6.0
Visual C++ 5
Delphi 5

-
Oct 21st, 2000, 09:33 PM
#2
To download a file from the Internet with IE, use the DoFileDownload api function:
Code:
Private Declare Function DoFileDownload _
Lib "shdocvw.dll" (ByVal lpszFile As _
String) As Long
Private Sub Command1_Click()
Dim sDownload As String
sDownload = StrConv("http://www.site.com/downloads/file.zip", vbUnicode)
Call DoFileDownload(sDownload)
End Sub
-
Oct 22nd, 2000, 05:21 AM
#3
Thread Starter
Fanatic Member
what if I want it to download a file without anyone seing that stupid window!
Visual Basic 6.0
Visual C++ 5
Delphi 5

-
Oct 22nd, 2000, 09:11 PM
#4
You can use the URLDownloadToFile api function to do this.
Code:
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
Usage
MsgBox DownloadFile("http://www.vb-world.net", "c:\vbworld.htm")
-
Apr 13th, 2001, 10:22 AM
#5
New Member
DId you have this problem use the recommended coding for background downloading file from internet to local drive.
Error message as follow:-
" can't find DLL entry point URLdownloadtofile in urlmon"
Anyone have similar problom and how to solve it.
My operating system is windows2000, did this windows related problem?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|