Recent

Author Topic: Download HTML  (Read 4305 times)

tuxmartin

  • New member
  • *
  • Posts: 8
Download HTML
« on: August 24, 2011, 10:12:32 pm »
I need to download this HTML http://dl.dropbox.com/u/6943408/version.html and save the content into a variable => version := '1 .0 '
I tried download http://dl.dropbox.com/u/6943408/version.html in wget and save to text file and then open this file in Lazarus.

How can I do without wget?
http://www.gnu.org/s/wget/

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: Download HTML
« Reply #1 on: August 24, 2011, 10:28:09 pm »

Silvio Clécio

  • Guest
Re: Download HTML
« Reply #2 on: August 24, 2011, 11:04:26 pm »
This is very simple, please see:

http://imagebin.org/169524

Demo:

Code: [Select]
uses
  LSHTTPSend;

procedure TForm1.Button1Click(Sender: TObject);
var
  VVersion: TStringList;
begin
  VVersion := TStringList.Create;
  try
    LSHTTPGetText('http://dl.dropbox.com/u/6943408/version.html', VVersion);
    if VVersion.Text <> '' then
      Edit1.Text := VVersion.Text
    else
      ShowMessage('Could not get the version.');
  finally
    VVersion.Free;
  end;
end;

SVN of LazSolutions (use TortoseSVN to download all sources):

http://lazsolutions.googlecode.com/svn

Good luck. :)

 

TinyPortal © 2005-2018