FTPダウンロード:http://www.7880.com/info/article-19938be0.html
http://community.csdn.net/expert/topic/3300/3300012.xml?temp=5.028933e-02
FTPダウンロード:TIDFTPコントロール(Delphi7 Indy)
httpダウンロード:( delphi7)デザインインディコントロールを使用してネットワークファイルをダウンロード////////////
フォーム1にコントロールを追加します:
2つのインディコントロール:idantifreeze1、idhttp1;
ボタン:Button1;
進行状況バー:ProgressBar1はダウンロード速度を表示します
手順tform1.button1click(sender:tobject);
var
mystream:tmemorystream;
始める
idantifreeze1.lywhenidle:= false; //プログラムを反応させるように設定します。
mystream:= tmemorystream.create;
試す
idhttp1.get( 'http://www.appcontrols.com/demos/exe/httpdemo.exe',Mystream);
を除外する
showmessage( 'ダウンロードが成功しなかった!');
mystream.free;
出口;
終わり;
mystream.savetofile(extractfilepath(paramstr(0))+'httpdemo.zip');
mystream.free;
showmessage( 'ok');
終わり;
手順tform1.idhttp1workbegin(sender:tobject; aworkmode:tworkmode;
const aworkcountmax:integer);
始める
//ダウンロードを開始する前に、ProgressBar1の最大値を受信する必要があるデータサイズに設定します。
ProgressBar1.max:= aworkCountMax;
ProgressBar1.min:= 0;
ProgressBar1.Position:= 0;
終わり;
手順tform1.idhttp1work(sender:tobject; aworkmode:tworkmode;
const aworkcount:integer);
始める
//データを受信すると、進行状況が進行中に表示されます1。
ProgressBar1.Position:= ProgressBar1.Position+AworkCount;
終わり;