高分求一个FTP软件制作的完整代码例程

linda2 2003-08-30 01:15:46
大家好,除了这里的分数另外再给100,小女子求一个完整的类似于FlaxFTP的用delphi开发的ftp软件代码,功能要齐全不能仅仅是down和up,其他功能越多越好。由于本人在开发这样的一个工具,上传下载全都弄好了,现在那些类似于用代理去连接和用http,socket那些去连接那些不会,所以希望有个完整的工具代码,急阿!求哪位帮一下我不胜感激!
...全文
51 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhksoft 2003-09-07
  • 打赏
  • 举报
回复
去这里看看http://www1.baidu.com/baidu?cl=3&word=delphi+ftp
fhuibo 2003-09-06
  • 打赏
  • 举报
回复
delphi中的nmftp控件中Download函数只能下载一个文件,没有提供一个下载整个目录(包含子目录)的函数。
file://目录下载

function tftp.ex_download(remote_dir,local_dir:string):boolean;

var

i,j,count1:integer;

att,ss:string;

current_dir:string;

temp_dir:string;

begin

try begin

NMFTP1.ChangeDir(remote_dir);

current_dir:=remote_dir;

temp_dir:=copy(current_dir,2,length(current_dir));

if not DirectoryExists(local_dir) then CreateDir(local_dir);

if not directoryexists(local_dir+temp_dir) then createdir(local_dir+temp_dir);

nmftp1.ParseList:=true;

NMftp1.list;

count1:=nmftp1.FTPDirectoryList.name.Count;

for i:=0 to count1-1 do begin

file://必须

NMFTP1.ChangeDir(current_dir);

nmftp1.list;

ss:=nmftp1.FTPDirectoryList.name.Strings[i];

att:=nmftp1.FTPDirectoryList.Attribute.Strings[i];

if (copy(pchar(att),1,1)<>'d')and(copy(pchar(att),1,1)<>'D') then begin

if not DirectoryExists(local_dir) then CreateDir(local_dir);

NMFTP1.Download(current_dir+ss,local_dir+temp_dir+ss);

end

else begin

if not directoryexists(local_dir+temp_dir+ss) then createdir(local_dir+temp_dir+ss);

file://递归调用

ex_download(remote_dir+ss+',local_dir);

end;

end;

result:=true;

end

except

On E:Exception do begin

result:=false;

end;

end;

end;
linda2 2003-09-05
  • 打赏
  • 举报
回复
没戏了怎么没有人弄过这个!艾惨了这次
linda2 2003-09-04
  • 打赏
  • 举报
回复
怎么没有人开发过用那些http socket代理连接的ftp工具吗?
心痛咯!55555555555555555
jackie168 2003-09-03
  • 打赏
  • 举报
回复
靠,樓上是星星?
WoGanCSDN 2003-09-03
  • 打赏
  • 举报
回复
MM???
linda2 2003-09-03
  • 打赏
  • 举报
回复
救救我阿同志们!谁会用那个socket和http的帮帮忙谢谢
linda2 2003-09-02
  • 打赏
  • 举报
回复
哎呀下载到了,运行了可是这个例程不是我所要的阿!我上面说了我说不能只能down和up阿!我需要的是用代理可以去连接那种阿!晕咯!对不起阿大家再帮帮忙可以吗?就是可以用socket和http那些出去连接那种阿!
goomoo 2003-09-02
  • 打赏
  • 举报
回复
下载页面:

http://www.indyproject.org/download/index.html
linda2 2003-09-02
  • 打赏
  • 举报
回复
indy控件?我没有7装噢!请问谁有这个控件谢谢^_^!
oklida 2003-09-01
  • 打赏
  • 举报
回复
你安装了Delphi7就可以用了,这个例程就是用的indy而已
linda2 2003-09-01
  • 打赏
  • 举报
回复
to goomoo
你好很感谢你,现在我delphi是原装版没有装过任何新的控件,你那个例程有很多控件我都没有
希望你把那些控件给我down可以吗?非常感谢^_^我会给分的放心
goomoo 2003-09-01
  • 打赏
  • 举报
回复
对不起,链接错误:
http://www.goomoo.net/tmp/FTP.rar
goomoo 2003-09-01
  • 打赏
  • 举报
回复
点击下载:

http://www.goomoo.net/tmp/ftp.rar

记得给分哦。 :)
benchiufo 2003-09-01
  • 打赏
  • 举报
回复
\Program Files\Borland\Delphi6\Demos\FastNet
有例子!
fhuibo 2003-09-01
  • 打赏
  • 举报
回复
从网络中下载一个指定文件
uses
URLMon, ShellApi;

function DownloadFile(SourceFile, DestFile: string): Boolean;

begin

try

Result := UrlDownloadToFile(nil, PChar(SourceFile), PChar(DestFile), 0, nil) = 0;

except

Result := False;

end;

end;

procedure TForm1.Button1Click(Sender: TObject);

const

// URL Location

SourceFile = 'http://www.google.com/intl/de/images/home_title.gif';

// Where to save the file

DestFile = 'c:image.gif';

begin

if DownloadFile(SourceFile, DestFile) then

begin

ShowMessage('Download succesful!');

// Show downloaded image in your browser

ShellExecute(Application.Handle, PChar('open'), PChar(DestFile),

PChar(''), nil, SW_NORMAL)

end

else

ShowMessage('Error while downloading ' + SourceFile)

end;

// Minimum availability: Internet Explorer 3.0

// Minimum operating systems Windows NT 4.0, Windows 95

******************************

2.}

uses

Wininet;

function DownloadURL(const aUrl: string): Boolean;

var

hSession: HINTERNET;

hService: HINTERNET;

lpBuffer: array[0..1024 + 1] of Char;

dwBytesRead: DWORD;

begin

Result := False;

// hSession := InternetOpen( 'MyApp', INTERNET_OPEN_TYPE_DIRECT, nil, nil, 0);

hSession := InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);

try

if Assigned(hSession) then

begin

hService := InternetOpenUrl(hSession, PChar(aUrl), nil, 0, 0, 0);

if Assigned(hService) then

try

while True do

begin

dwBytesRead := 1024;

InternetReadFile(hService, @lpBuffer, 1024, dwBytesRead);

if dwBytesRead = 0 then break;

lpBuffer[dwBytesRead] := #0;

Form1.Memo1.Lines.Add(lpBuffer);

end;

Result := True;

finally

InternetCloseHandle(hService);

end;

end;

finally

InternetCloseHandle(hSession);

end;

end;

******************************

在Delphi中如何从网络中提取一个文件到本地计算机中,如提取<BR> http://www.abcdefg.com/software/a.zip到本地指定的目录中?

在窗体中添加1个TNMHTTP控件(在FastNet页)然后在随便那个Button什么的下面

加入如下代码:

 

NMHTTP1.InputFileMode := ture;

NMHTTP1.Body := '本地文件名';

NMHTTP1.Header := 'Head.txt';

NMHTTP1.OutputFileMode := FALSE;

NMHTTP1.ReportLevel := Status_Basic;

NMHTTP1.Proxy := '代理服务器的IP地址';

NMHTTP1.ProxyPort := '代理服务器的端口号';

With NMHTTP1.HeaderInfo do

Begin

Cookie := '';

LocalMailAddress := '';

LocalProgram := '';

Referer := '';

UserID := '用户名称';

Password := '用户口令';

End;

NMHTTP1.Get(‘http://www.abcdefg.com/software/a.zip’);

试试吧,Delphi的目录中有TNMHTTP控件的例子。

NT4+,Win95+,IE3+,你可以用URL Moniker的功能。

uses URLMon;

...

OleCheck(URLDownloadToFile(nil,'URL','Filename',0,nil));

其中最后一个参数你还可以传入一个IBindStatusCallback的实现以跟踪下载进度或控制中止下载。简单的场合一句话就搞定了。




qxceo 2003-08-30
  • 打赏
  • 举报
回复
呵呵~我也急要这个~记得有就发我一个拷贝~谢谢啦~大家帮忙啊~
my e-mail:qxceo@163.com
linda2 2003-08-30
  • 打赏
  • 举报
回复
分数不够的话可以再商量谢谢^_^

828

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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