Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading files from Internet 1

Status
Not open for further replies.

AndyWatt

Programmer
Oct 24, 2001
1,288
GB
Hi All,

I want to get an application to check for an updated version of itself, then download the new file.

The only thing I don't know how to do in VB is actually download the file...

Would someone be kind enough to give me some pointers/suggestions?

Many thanks


Andy
--
"Logic is invincible because in order to combat logic it is necessary to use logic." -- Pierre Boutroux
 
I found this code on this website a couple months ago. It works like a charm. I think it was Hypetia that posted it, but I could be wrong.

Code:
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (pCaller As Any, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

Function Download(URL As String, FileName As String) As Boolean

    Download = URLDownloadToFile(ByVal 0&, URL, FileName, 0, 0) = 0

End Function


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks gmmastros! That does exactly what I want.

And my thanks also to the original poster.


Andy
--
"Logic is invincible because in order to combat logic it is necessary to use logic." -- Pierre Boutroux
 
Earliest referece in this forum that I can find is thread222-37038, and most recent would be thread222-757916 (which is indeed Hypetia)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top