请问如何在DELPHI中实现向指定FTP服务器传送文件,请给代码,我很菜的。谢谢各位大侠了?在线等 请问如何在DELPHI中实现向指定FTP服务器传送文件,请给代码,我很菜的。谢谢各位大侠了?在线等 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 以下是简单的例子,使用的是Delphi 6中提供的FTP控件!!!仅供参考!!!Var FTP : TNMFTP; FileName : String; Done : Integer; Rec : TSearchRec; Path : String;begin FTP := TNMFTP.Create( Nil ); Try FTP.Host := FTPConfig.Host; FTP.Port := FTPConfig.Port; FTP.UserID := FTPConfig.User; FTP.Password := FTPConfig.Password; Try FTP.Connect; Path := ExtractFilePath( ParamStr( 0 ) ) + 'FUCAIT' + Copy( DataDate, 1, 4 ) + Copy( DataDate, 6, 2 ) + Copy( DataDate, 9, 2 ) + '01*.*'; Done := FindFirst( Path, faAnyFile, Rec ); While Done = 0 Do Begin FileName := ExtractFilePath( ParamStr( 0 ) ) + Rec.Name; FTP.Upload( FileName, ExtractFileName( FileName ) ); Done := FindNext( Rec ); End; FindClose( Rec ); Path := ExtractFilePath( ParamStr( 0 ) ) + 'FUCAIP' + Copy( DataDate, 1, 4 ) + Copy( DataDate, 6, 2 ) + Copy( DataDate, 9, 2 ) + '01*.*'; Done := FindFirst( Path, faAnyFile, Rec ); While Done = 0 Do Begin FileName := ExtractFilePath( ParamStr( 0 ) ) + Rec.Name; FTP.Upload( FileName, ExtractFileName( FileName ) ); Done := FindNext( Rec ); End; FindClose( Rec ); FTP.Disconnect; Except End; Finally FTP.Free; End;end; 我用DELPHI7 怎么没有你讲的控件那 当然NM已经淘汰的!!用Indy吧,站点可下载Demo这个问题N次,不想再多说啦http://lysoft.7u7.net 可以给我一份DEMO吗?[email protected] stringreplace报错 高分求助,按以下需求用delphi写代码? delphi7的MediaPlayer控件问题 关于treeview问题 (急) delphi与informix存储过程的一些问题 ■■请问如何让程序获得和修改其他程序的显示内容? 一个关于票据打印的问题? 我才刚开始学数据库.请问那里有教程吗? 求取本机MAC地址的Delphi代码,谢谢各位哥哥姐姐,祝你们长命百岁,越来越漂亮!!!!! 原问题已结贴, 再来个问题--100分 外键的定义问题 要是将单引号插入数据库中,该怎么处理?
FTP : TNMFTP;
FileName : String;
Done : Integer;
Rec : TSearchRec;
Path : String;
begin
FTP := TNMFTP.Create( Nil );
Try
FTP.Host := FTPConfig.Host;
FTP.Port := FTPConfig.Port;
FTP.UserID := FTPConfig.User;
FTP.Password := FTPConfig.Password;
Try
FTP.Connect;
Path := ExtractFilePath( ParamStr( 0 ) ) + 'FUCAIT' + Copy( DataDate, 1, 4 ) + Copy( DataDate, 6, 2 ) + Copy( DataDate, 9, 2 ) + '01*.*';
Done := FindFirst( Path, faAnyFile, Rec );
While Done = 0 Do
Begin
FileName := ExtractFilePath( ParamStr( 0 ) ) + Rec.Name;
FTP.Upload( FileName, ExtractFileName( FileName ) );
Done := FindNext( Rec );
End;
FindClose( Rec );
Path := ExtractFilePath( ParamStr( 0 ) ) + 'FUCAIP' + Copy( DataDate, 1, 4 ) + Copy( DataDate, 6, 2 ) + Copy( DataDate, 9, 2 ) + '01*.*';
Done := FindFirst( Path, faAnyFile, Rec );
While Done = 0 Do
Begin
FileName := ExtractFilePath( ParamStr( 0 ) ) + Rec.Name;
FTP.Upload( FileName, ExtractFileName( FileName ) );
Done := FindNext( Rec );
End;
FindClose( Rec );
FTP.Disconnect;
Except
End;
Finally
FTP.Free;
End;
end;
这个问题N次,不想再多说啦http://lysoft.7u7.net