lNet - Retrieving string from server lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Jishaxe · 2011-05-06 19:16 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 !" 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 · 2011-05-06 19:33 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: [Select] HttpGetText(url, htmlpage); 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 · 2011-05-06 19:39 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 · 2011-05-06 19:44 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 · 2011-05-06 21:22 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. ---------------------------------------------------------------------- Jishaxe · 2011-05-07 08:53 Okay, thank you Fabien and Mr. lNet, I will look into both,