|
-
Jan 17th, 2001, 06:10 PM
#1
Thread Starter
Fanatic Member
Short of dragging the Cache does anyone know how to use the WebBrowser Object to download EXE and binary files "transparently" to a predetermined directory on the computer?
WebBrowser1.Navigate "http://www.mydomain.com/download/setupex.exe"
will obviously do it with a pop-up box but I need the download to be "silent". This is my great chance to get rid of the retched ICK control 
-
Jan 17th, 2001, 06:20 PM
#2
Hyperactive Member
Not sure if this is what your looking for or not, i've never tried it, i just did i quick search and this popped up so give it a look
http://www.vb-world.net/internet/tip501.html
VB6.0 SP4
Windows 2000
I'm thinking of a number between
-
Jan 17th, 2001, 08:14 PM
#3
Thread Starter
Fanatic Member
Thanks
Thanks - that looks very promising - I'll try it and tell you what happens! 
-
Jan 18th, 2001, 05:43 AM
#4
Thread Starter
Fanatic Member
Yes it works but . .
. .any idea about how I can hold the execution of the next lines until the download has occurred?
---
BTW - what's happening to the cat in you sig file?
-
Jan 18th, 2001, 06:08 AM
#5
Thread Starter
Fanatic Member
OK - found the answer -
The function will then use the API to download the file and return a True if successful.
Thanks 
-
Feb 6th, 2001, 12:24 AM
#6
Lively Member
Here is some code that worked for me:
Private Sub Command1_Click()
Dim bFile() As Byte ' Retrieving a binary file.
bFile() = Inet1.OpenURL("http://www.domain.com/program.ext", icByteArray) 'Location of file to download
Open "saveas.ext" For Binary Access Write As #1 'What/where you want the saved file to be saved. If you put a name w/o a path, it will default to the path the running program is in
Put #1, , bFile()
Close #1
End Sub
This pulls the file down in the background. Does anyone know how to call the new file after it is downloaded?
Last edited by DugzDMan; Feb 6th, 2001 at 12:39 AM.
-
Feb 6th, 2001, 07:10 AM
#7
Originally posted by Kzin
. .any idea about how I can hold the execution of the next lines until the download has occurred?
Try adding the DoEvents function.
Also, you don't have to have it tell you if the download was successful or not.
Code:
DownloadFile "http://www.vb-world.net", "c:\vbworld.htm"
But if you do want it to tell you...
Code:
Dim Dl As Boolean
Dl = DownloadFile("http://www.vb-world.net", "c:\vbworld.htm")
If Dl = True Then
Msgbox "Download complete"
Else
Msgbox "An error occured when downloading the file.", 16
End If
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
|