Forum > Networking and Web Programming
lNet - Retrieving string from server
Jishaxe:
Hello people.
I'm using lNet and hoping to achieve this:
I'd like a bar at the top of my (GUI) program that displays a string that has been retrieved from my server such as
"Floody Alpha 1.0 released, download now at <link>!"
So it's like an update bar.
I was hoping to retrieve the string which is raw text in a txt file, such as www.myserver.com/update.txt, and every time you run the software it checks for a change.
The part I can't do is actually retrieving the string.
What I was thinking of doing was connecting to the webserver via TCPComponent and sending the GET command but I'm sure there's a much better way to do this.
Thanks in advance,
- Jishaxe
Edit: It's lNet, not LNet. .-.
gvnonor:
I know that you wanted an lnet solution, but if you
don't mind adding a dependency(the Synapse library), you can use a single line to get the string.
--- Code: --- HttpGetText(url, htmlpage);
--- End code ---
where url is a string(ex-: www.myserver.com/update.txt) and htmlpage is tstringlist which will contain all the lines in the file, after the call.
Jishaxe:
Hmm, this sounds like a brilliant way. I'll wait for other replies but if I don't get any then I'll do it.
fabienwang:
lnet (it's a L in lowercase) can do that easily.
Please look at lazpaint sources, i have made an update checker that gets a version from a webpage.
Almindor:
Look in lNet/examples/visual/http :)
Just change it so that instead of adding the data to memo it puts it where you need it.
Navigation
[0] Message Index
[#] Next page