大家好,除了这里的分数另外再给100,小女子求一个完整的类似于FlaxFTP的用delphi开发的ftp软件代码,功能要齐全不能仅仅是down和up,其他功能越多越好。由于本人在开发这样的一个工具,上传下载全都弄好了,现在那些类似于用代理去连接和用http,socket那些去连接那些不会,所以希望有个完整的工具代码,急阿!求哪位帮一下我不胜感激!

解决方案 »

  1.   

    呵呵~我也急要这个~记得有就发我一个拷贝~谢谢啦~大家帮忙啊~
    my e-mail:[email protected]
      

  2.   

    \Program Files\Borland\Delphi6\Demos\FastNet 
    有例子!
      

  3.   

    点击下载:http://www.goomoo.net/tmp/ftp.rar记得给分哦。 :)
      

  4.   

    对不起,链接错误:
    http://www.goomoo.net/tmp/FTP.rar
      

  5.   

    从网络中下载一个指定文件    
      uses 
    URLMon, ShellApi;function DownloadFile(SourceFile, DestFile: string): Boolean;begintryResult := UrlDownloadToFile(nil, PChar(SourceFile), PChar(DestFile), 0, nil) = 0;exceptResult := False;end;end;procedure TForm1.Button1Click(Sender: TObject);const// URL LocationSourceFile = 'http://www.google.com/intl/de/images/home_title.gif';// Where to save the fileDestFile = 'c:image.gif';beginif DownloadFile(SourceFile, DestFile) thenbeginShowMessage('Download succesful!');// Show downloaded image in your browserShellExecute(Application.Handle, PChar('open'), PChar(DestFile),PChar(''), nil, SW_NORMAL)endelseShowMessage('Error while downloading ' + SourceFile)end;// Minimum availability: Internet Explorer 3.0// Minimum operating systems Windows NT 4.0, Windows 95******************************2.}usesWininet;function DownloadURL(const aUrl: string): Boolean;varhSession: HINTERNET;hService: HINTERNET;lpBuffer: array[0..1024 + 1] of Char;dwBytesRead: DWORD;beginResult := False;// hSession := InternetOpen( 'MyApp', INTERNET_OPEN_TYPE_DIRECT, nil, nil, 0);hSession := InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);tryif Assigned(hSession) thenbeginhService := InternetOpenUrl(hSession, PChar(aUrl), nil, 0, 0, 0);if Assigned(hService) thentrywhile True dobegindwBytesRead := 1024;InternetReadFile(hService, @lpBuffer, 1024, dwBytesRead);if dwBytesRead = 0 then break;lpBuffer[dwBytesRead] := #0;Form1.Memo1.Lines.Add(lpBuffer);end;Result := True;finallyInternetCloseHandle(hService);end;end;finallyInternetCloseHandle(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 doBeginCookie := '';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的实现以跟踪下载进度或控制中止下载。简单的场合一句话就搞定了。
     
       
      

  6.   

    to goomoo  
    你好很感谢你,现在我delphi是原装版没有装过任何新的控件,你那个例程有很多控件我都没有
    希望你把那些控件给我down可以吗?非常感谢^_^我会给分的放心
      

  7.   

    你安装了Delphi7就可以用了,这个例程就是用的indy而已
      

  8.   

    indy控件?我没有7装噢!请问谁有这个控件谢谢^_^!
      

  9.   

    下载页面:http://www.indyproject.org/download/index.html
      

  10.   

    哎呀下载到了,运行了可是这个例程不是我所要的阿!我上面说了我说不能只能down和up阿!我需要的是用代理可以去连接那种阿!晕咯!对不起阿大家再帮帮忙可以吗?就是可以用socket和http那些出去连接那种阿!
      

  11.   

    救救我阿同志们!谁会用那个socket和http的帮帮忙谢谢
      

  12.   

    怎么没有人开发过用那些http socket代理连接的ftp工具吗?
    心痛咯!55555555555555555
      

  13.   

    delphi中的nmftp控件中Download函数只能下载一个文件,没有提供一个下载整个目录(包含子目录)的函数。 
    file://目录下载function tftp.ex_download(remote_dir,local_dir:string):boolean;vari,j,count1:integer;att,ss:string;current_dir:string;temp_dir:string;begintry beginNMFTP1.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 beginfile://必须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 beginif not DirectoryExists(local_dir) then CreateDir(local_dir);NMFTP1.Download(current_dir+ss,local_dir+temp_dir+ss);endelse beginif 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;endexceptOn E:Exception do beginresult:=false;end;end;end;
      

  14.   

    去这里看看http://www1.baidu.com/baidu?cl=3&word=delphi+ftp