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 / Looking for way to read conents of a .txt file from website ?

Author
Message
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 20th Aug 2011 01:46
I have a version,txt file on my website I want my program to read and compare. Does anyone know a method for read a file from a remote site or commands etc.

If the file needs to be downloaded and read thats fine, but cant find out how to do this. thx
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Aug 2011 08:18
did you try

open to read 'www.domain.com/version.txt',version$

and well get the rest of the syntax from F1 support... I believe I did it this way...

Sorry for not providing the whole syntax its on one of my external hdd's my data is in a mess atm m moving offices...

I believe it will only read the first string$ so make it short and sweet

later compare the string localversion$ to version$ {version$ being your new version.

hope this helped, if still stuck I will dig out my full working method... there was also a plugin involved... for http download... but i believe I found a methos whereas you access the file directly as above within DBPro

thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 29th Aug 2011 14:47
Quote: "open to read 'www.domain.com/version.txt',version$"


That's not at all how that command works. The file commands can only read from the local file.

If you want just a simple function, you can use this. The benefits of using just this function are that it's very simple, self-contained, and requires no extra plugins.



To use this function, just pass the URL of the download to the from$ variable, and the filename to save to as the to$ variable.
The only problem with this is that the download runs in a separate process, and won't stop your program. So you might have trouble with that unless you are familiar with the windows API.

If you want a good plugin that can do the same features, try the Download plugin by Rudolpho. I haven't used it but it seems good.

Login to post a reply

Server time is: 2026-07-10 19:06:21
Your offset time is: 2026-07-10 19:06:21