Temporary file with Indy

Asked

Viewed 80 times

3

Well, I’m trying to download a text file and get a Richedit to take the content from that file. But I don’t really know how to do it. I tried so:

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

I know it doesn’t work, because Idhttp’s Get type is not string, I would like to know how to do. PS: The file contains several lines. Thanks in advance.

Edit: I got it this way:

news := 'http://pokestage.ddns.net/patch/News.txt';
sRichEdit1.Text := IdHTTP2.Get(news);

1 answer

4


Making use of class TIdHTTP of Indy, you can do it this way:

http.ExecuteURL('http://pokestage.ddns.net/patch/patchlist.txt');
sRichEdit1.Lines.Add(http.sl.Text);
  • Thanks, but I got it some other way.

  • Share your knowledge and answer your question with your method, it may help others in the future :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.