Temporary file with indy

3

Well, I'm trying to download a text file and get a RichEdit to grab the contents of that file. But I'm not sure how to do it. I tried this way:

news := 'http://pokestage.ddns.net/patch/patchlist.txt';
sRichEdit1.Lines[1] := IdHTTP2.Get(news);

I know it does not work, because IdHttp's Get type is not string, I'd like to know how to do it. PS: The file contains multiple lines. Thanks in advance.

Edit: I was able to do this:

news := 'http://pokestage.ddns.net/patch/News.txt';
sRichEdit1.Text := IdHTTP2.Get(news);
    
asked by anonymous 17.10.2014 / 13:05

1 answer

4

Using the class TIdHTTP of < in> Indy , you can do the following:

http.ExecuteURL('http://pokestage.ddns.net/patch/patchlist.txt');
sRichEdit1.Lines.Add(http.sl.Text);
    
17.10.2014 / 13:38