比如知道一个超链接,如何用程序下载其内容!

huojiehai 2003-01-01 10:52:02
如‘http://320.bwan.org/funny/beach.exe',我如何才能用程序下载beach.exe这个文件
...全文
30 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Billy_Chen28 2003-01-04
  • 打赏
  • 举报
回复
用NMHTTP控件,代码如下:
代理服务器用的是WINgate,IP是:202.102.13.2 端口是:8078
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Psock, NMHttp, ComCtrls, StdCtrls;

type
TForm1 = class(TForm)
NMHTTP1: TNMHTTP;
StatusBar1: TStatusBar;
Label1: TLabel;
Label2: TLabel;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
nmhttp1.Proxy :='202.102.13.2';
nmhttp1.ProxyPort :=8078;
//nmhttp1.Host :='www.sina.com.cn/index.asp';
nmhttp1.Port :=80;
nmhttp1.ReportLevel :=1;
nmhttp1.InputFileMode :=false;
nmhttp1.OutputFileMode :=false;
nmhttp1.Connect ;
statusbar1.Panels [0].Text :='连接上新浪网!';
label1.Caption :=nmhttp1.RemoteIP;
label2.Caption :=nmhttp1.LocalIP ;
//nmhttp1.Get('www.njcein.com.cn\index.asp');
memo1.Lines.Add (nmhttp1.Header);
memo1.Lines.Add (nmhttp1.Body);
end;

end.
goodloop 2003-01-04
  • 打赏
  • 举报
回复
不明白,关注

up
zxfsdbj 2003-01-02
  • 打赏
  • 举报
回复
引用shellapi单元
同时写如下事件
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(handle,'open',pchar('http://320.bwan.org/funny/beach.exe'),Nil,Nil,SW_SHOWNORMAL);
end;
man8888 2003-01-02
  • 打赏
  • 举报
回复
不过得需要显示下载进度呀!
1、要知道文件大小。
2、要知道下载了多少。
恩。。不明白!
haojie 2003-01-02
  • 打赏
  • 举报
回复
使用流进行读取吧!
jackystar 2003-01-02
  • 打赏
  • 举报
回复
up
wenguang 2003-01-02
  • 打赏
  • 举报
回复
如果你安装了GlashGet下载软件的话,直接在浏览器地址栏中输入‘http://320.bwan.org/funny/beach.exe'就可以了。
wenguang 2003-01-02
  • 打赏
  • 举报
回复
另存为
huojiehai 2003-01-02
  • 打赏
  • 举报
回复
TO zxfsdbj(飞飞猫),如何得知一个已下载完
TO wenguang(吟天涯)我要的是用程序下载
TO haojie(超级解霸) 用流如何进行
各位高手,正如man8888(北京男人)所说的,如何做呀 ,请给出例子

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧