b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

delphi 从http 上下载文件的几种方法

电脑杂谈  发布时间:2019-07-12 08:09:53  来源:网络整理

delphi下载文件_delphi下载文件_delphi idhttp 下载文件

1、利用函数

unitdownloadTest;

interface

uses

Windows,Messages,SysUtils,Variantsdelphi下载文件,Classes,Graphics,Controls,Forms,

Dialogs,StdCtrls,UrlMon;

type

TForm1=class(TForm)

Button1:TButton;

delphi下载文件_delphi idhttp 下载文件_delphi下载文件

procedureButton1Click(Sender:TObject);

private

{Privatedeclarations}

public

{Publicdeclarations}

end;

var

Form1:TForm1;

implementation

delphi下载文件_delphi idhttp 下载文件_delphi下载文件

{$R*.dfm}

//文件下载

functionDownloadFile(Source,Dest:string):Boolean;

begin

try

Result:=UrlDownloadToFile(nil,PChar(source),PChar(Dest),0,nil)=0;

except

Result:=False;

end;

delphi下载文件_delphi下载文件_delphi idhttp 下载文件

end;

procedureTForm1.Button1Click(Sender:TObject);

varfiledir,downloadUrl:string;

begin

filedir:='D:\delphi\download\client.zip';

para=izone&pt_qr_app=手机qq空间&pt_qr_link=http://z.qzone.com/download.html&self_regurl=http://qzs.qq.com/qzone/v6/reg/index.html&pt_qr_help_link=http://z.qzone.com/download.htmllogin_sig=,login_sig:"vvv.qqydw.com&u1=http://qzs.qq.com/qzone/v5/loginsucc.html。http://dg.chinawj.com.cn/product/173069267.html http://nyhb.chinawj.com.cn/gongying/172889313.html http://tools.chinawj.com.cn/product/172887757.html http://suliao.chinawj.com.cn/product/172970767.html。displaylang=zh-cn&familyid=bc327d94-4f2c-481f-8595-fa5b90b11bfc" target="_blank">http.com/download/4/1/8/418981a4-6ef9-4de6-befc-1a53e886cb62/ie7-windowsxp-x86-chs:http.microsoft.aspx.com/downloads/detailsxp sp2://download.microsoft.microsoft://download://www.com/downloads/details:。

ifDownloadFile(downloadUrl,filedir)then

showMessage('文件下载成功')

else

delphi下载文件_delphi下载文件_delphi idhttp 下载文件

showMessage('文件下载失败');

end;

end.

2、用IdHTTP控件吧!

var

DownLoadFile:TFileStream;

beginio

DownLoadFile:=TFileStream.Create('c:\aa.rar'delphi下载文件,fmCreate);

idhttp1.get(''http://www.sina.com.cn/download/aa.rar'',downloadfile)。oo.href = ['http://baidu.com','http://www.cnblogs.com','http://www.sina.com','http://www.hao123.com','http://www.taobao.com']。console.trace()at c (http://www.contoso.com/trace.html:24:3)at a (http://www.contoso.com/trace.html:18:3)at global code (http://www.contoso.com/trace.html:30:1)console.trace()at c (http://www.contoso.com/trace.html:24:3)at b (http://www.contoso.com/trace.html:21:3)at d (http://www.contoso.com/trace.html:27:3)at global code (http://www.contoso.com/trace.html:31:1)。

DownLoadFile.Free;

end;


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-112343-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      • 李从周
        李从周

        加表情什么鬼

      • 宋特
        宋特

        没真正打过不知道自己有多少毛病

      • 温碧霞
        温碧霞

        • 诡计多端的家管家诺
          诡计多端的家管家诺

          派军舰无害通过钓鱼岛12海里之内

      热点图片
      拼命载入中...