Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Command for reading a file from http website ?

Author
Message
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 12th Aug 2011 02:00
I have looked high and low and need a command to allow me to read a string of text or numbers from a file on a website.

Something like this, but that works...

Rem ***** Main Source File *****
Sync Rate 0
Filename$="http://www.grandprixteammanager.com/version.txt"
If File Exist (Filename$)
Open To Read 1,Filename$

Read String 1,version$

Close File 1
Endif

Text 100,100,"Version "+(version$)
sync
Wait 50000

End

Help appreciated
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 12th Aug 2011 02:26
have a look at the help files ftp example program.

it opens a website and loads a list of files that are hosted there.

all you would need to add is to copy the file to your pc and open it. then it would come down to file commands.

I haven't worked with internet connection stuff yet, but the example worked and the links are still valid. seems like a good place to start.

good luck

kezzla

Sometimes I like to use words out of contents
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 12th Aug 2011 02:54
Actually i just found a gogas plugin with a Downloadfile command


print "Downloading..."
sync
Success = DownloadFile("http://www.GRANDPRIXTEAMMANAGER.COM/VERSION.TXT","VERSION.TXT")
print "Downloaded."
print "Success? "+str$(Success)
wait key
Arbrakan
15
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 12th Aug 2011 02:59 Edited at: 12th Aug 2011 02:59
What is de name of that plugin ?
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 12th Aug 2011 10:32
There's also a windows DLL file which includes the downloadtofile function. Cant remember the one, winsock.dll or something???

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2026-07-10 13:44:44
Your offset time is: 2026-07-10 13:44:44