Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Downloading a file from internet?
#1
I tried to make it work in freebasic but no luck so far :oops:

It is supposed to download a txt file from a specific location. It compiles fine but it doesn’t download the file. Any thoughts what I am doing wrong.

Code:
'' Function FGetFileHTTP_URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByRef szURL As String, ByRef szFileName As String,ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
'$include: 'win\kernel32.bi'
Dim dummy as long
Dim url$
Dim OFile$
url$="http://www.ase.gr/content/gr/MarketData/Stocks/Prices/Files/txt/20050221.txt"
OFile$="quotes.txt"
Dim FGetFileHTTP_URLDownloadToFile as function (ByVal pCaller As Long, ByRef szURL As String, ByRef szFileName As String,ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
   dim hlib as integer
   hlib = LoadLibrary("urlmon.dll")
   FGetFileHTTP_URLDownloadToFile = GetProcAddress( hlib, "URLDownloadToFileA" )
   dummy = FGetFileHTTP_URLDownloadToFile (0, url$, OFile$,0, 0)
sleep
Reply


Messages In This Thread
Downloading a file from internet? - by gbos - 02-22-2005, 03:32 PM
Downloading a file from internet? - by v3cz0r - 02-22-2005, 08:46 PM
Downloading a file from internet? - by gbos - 02-22-2005, 09:08 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)