下载文件并执行,主要是学习下IDHTTP跟进度条控件的使用
专不了图片,自己下载附件看吧,在此感谢鱼老湿的教程,人中学到了不少知识,还望陆续更新后期的教程!哈哈哈,你的那个皮肤不错,能共享下吗?兄弟{:1_1:} 能提供下源码学习吗? zhuojialu 发表于 2012-12-2 21:40 static/image/common/back.gif
能提供下源码学习吗?
procedure TForm1.bsSkinButton1Click(Sender: TObject);
var mystream1 :TMemoryStream;
begin
bsSkinButton1.Enabled := False;
mystream1 :=TMemoryStream.Create;
IdHTTP1.Get('http://list.image.baidu.com/t/image/w_mengchong.jpg',mystream1);//下载文件地址
mystream1.SaveToFile('1.jpg');
ShowMessage('升级成功');
bsSkinButton1.Enabled := true;
ShellExecute(0,'open','1.jpg',nil,nil,sw_show);
bsSkinGauge1.value:=0;
end;
procedure TForm1.IdHTTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
begin
bsSkinGauge1.MaxValue:=AWorkCountMax;
bsSkinGauge1.MinValue:=0;
bsSkinGauge1.Value:=0;
end;
procedure TForm1.IdHTTP1Work(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer);
begin
bsSkinGauge1.Value:=bsSkinGauge1.Value+AWorkCount;
end;
end.
页:
[1]