[原创]简单的下载程序或页面
简单的下载程序或页面,入门级的。高手没必要看,让刚入门的朋友慢慢来提高。unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function xingkedownload(Caller: cardinal; URL: PChar; FileName: PChar;Reserved: LongWord; StatusCB: cardinal):Longword; stdcall; external 'URLMON.DLL' name 'URLDownloadToFileA';
procedure TForm1.Button1Click(Sender: TObject);
begin
xingkedownload(0,'http://sports.sina.com.cn/k/2007-11-03/15243268332.shtml', 'C:\xingke\两连胜火箭信心倍增.html', 0, 0);//这里是下载页面
//xingkedownload(0,'所下载的文件地址', '所保存的文件地址', 0, 0);//这里是下载文件
end;
end.
页:
[1]