怎么编程实现从网上下载FLASH(10分)

  • 主题发起人 主题发起人 birch2002
  • 开始时间 开始时间
B

birch2002

Unregistered / Unconfirmed
GUEST, unregistred user!
怎么编程实现从网上下载FLASH
 
//用了indy控件,
IdHTTP1: TIdHTTP;
...
procedure TForm1.Button1Click(Sender: TObject);
var
tmpStream:TFileStream;
begin
tmpStream:=TFileStream.Create('c:/get.swf',fmCreate);
try
idhttp1.Get('http://www.xxx.com/xxx.swf',tmpStream);
finally
tmpStream.Free;
end;
end;
 
那怎么实现进度条显示啊,谢谢
 
再开一贴告诉你!这贴分太少![:)]
 
你要多少啊,我只有55分啊
 
到http://www.tommstudio.com/ 上看一下,有下载这方面的例子
 
大家帮帮忙啊
 
白送![:)]
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdHTTP, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
IdHTTP1: TIdHTTP;
ProgressBar1: TProgressBar;
procedure Button1Click(Sender: TObject);
procedure IdHTTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
procedure IdHTTP1WorkEnd(Sender: TObject; AWorkMode: TWorkMode);
procedure IdHTTP1Work(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
tmpStream:TFileStream;
begin
tmpStream:=TFileStream.Create('c:/get.swf',fmCreate);
try
idhttp1.Get('http://www.xxx.com/xxx.swf',tmpStream);
finally
tmpStream.Free;
end;

end;

procedure TForm1.IdHTTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
begin
ProgressBar1.Max:=AWorkCountMax;
end;

procedure TForm1.IdHTTP1WorkEnd(Sender: TObject; AWorkMode: TWorkMode);
begin
ProgressBar1.Position:=0;
end;

procedure TForm1.IdHTTP1Work(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer);
begin
ProgressBar1.Position:=AWorkCount;
end;

end.
 
谢谢啊,你有没有什么联系方式啊
 
QQ:21672639
Email:yahoo.com@263.net(别炸我[:)])
 
谢谢啊,我是刚学DELPHI的啊,
 
接受答案了.
 
后退
顶部