THttpでファイルをダウンロードする

Delphi 3 のプロフェッショナル版以上に付いてくる THTTPコンポーネントの使い方です。このコントロールは HTTPでサーバー上のファイルを取得したり、転送したりできます。

■ HTTPコントロールでサーバー上のファイルをダウンロードする例
  procedure TForm1.Timer1Timer(Sender: TObject);
  var
    strSvrFile   :  string;
    strLocalFile :  string;
  begin
    { ビジー状態? }
    if  Not HTTP1.Busy  then
    begin
      { 取得するサーバーのパスとファイル名 }
      strSvrFile   :=  'http://ring.aist.go.jp/archives/public/delphi/ml/dml500.html'; 
      { ダウンロードしたファイルの格納先 }
      strLocalFile :=  'c:\work\dml500.html';
      { ダウンロード開始 }
      HTTP1.GetDoc(strSvrFile,'http',strLocalFile);
    end;
  end;