delphi idftp控件用法(Delphi idftp控件用法)
Delphi idftp control usage 2011-04-25 22:22FTP is a standard protocol that is the easiest way to exchange files between a computer and a network.
FTP is also an application protocol standard for applying TCP/IP protocol.
FTP usually in the file upload to the server, a commonly used way or from the server file transfer as a user, you can use FTP with a very simple DOS interface, can also be provided by the use of third party software (such as FLASHFXP) to the data server to delete, rename and other operations.
Of course, before using these, you have to log on to the server and log in with the specified username and password or Anonymous.
You know, but let's just talk about it. Using DOS to operate FTP, I'm not talking. Today I'm using IDFTP controls in INDY components to make a FTP client software (very simple)
I'm going to talk about some of the properties of the IDFTP control:
Host:FTP server address.
USER: user account number.
Password: password.
Passive: method for controlling FTP data connection. FTP data transmission can be active and passive.
PORT is active mode, when the data channel is established, the server to connect to others;
PASV is passive mode. When the data channel is set up, the server is connected to others;
When establishing data channel, PORT mode or PASV mode, the right of choice lies in the FTP client.
The passive in IDFTP is a Boolean data type. When True is active; when false is passive.
The default port for Port:FTP service is 21.
The type of TransferType: transport file can be valued as FtBinary (8 bit arbitrary file) and FtAscii (7 bit text file).
Description of SystemDesc:FTP server.
Several methods of IDFTP
The commonly used methods are as follows:
Connect: connects to the FTP server
Abort: stops the operation of FTP services.
Quit: closes the connection between the client and the server
Noop: is used to maintain connection commands and prevent connections from being turned off by the server
List: gets the list of files and directories on the FTP server
Prototype for
Procedure List (ADest:TStrings; Const ASpecifier:String; const ADetails:Boolean);
RetrieveCurrentDir: gets the name of the current directory
Site: sends commands to the FTP server
Prototype for:
Procedure Site (const ACommand:string);
ChangeDir: changes the current directory on the FTP server
The prototype is: procedure ChangeDir (const ADirName:string);
ChangeDirUp: returns the directory on the FTP server to your directory
Wenzhou -Dillon (86695893) 13:08:26
MakeDir: creates a new directory on the server
Prototype for:
Procedure MakeDir (const ADirName:String);
RemoveDir: deletes a directory on the server
Prototype for:
Procedure RemoveDir (const ADirName:string);
Get: downloads files from the FTP server. This method is overloaded
Prototype for:
Procedure Get (const ASourceFile:string; ADest:TStream); overload;
Procedure Get (const ASourceFile:string; const ADest:string; ACanOverWrite:Boolean); overload;
Put: is used to upload files to the server. This method is overloaded
Prototype for:
Procedure Put (const ASourceFile:TStream; const ADest:string; const Appand:Boolean); overload;
Procedure Put (const ASourceFile:string; const ADest:string; const AAppand:Boolean); overload;
KillDataChannal: closes the FTP data channel
The so-called "overloading" means that when some methods are inherited from multiple classes, conflicts can occur. In order to avoid this conflict, the overloaded function is used
Delete: deletes a file on the FTP server
原形为:程序删除(const afilename:字符串);
重命名:更改服务器上的文件名。
原型为:
getsavefilename程序重命名(const asourcefile:字符串;const adestfile:字符串);
尺寸:获取文件大小信息。
原型为:
功能尺寸(const afilename:字符串):整数;
当大家装好indy9.0附带一个例程,在印\ ftpdemo下可以到。
是一个不错的演示
我仿造这个做的一个例子里面包含详细的注释演示。
当然,还要讲一下,做FTP客户端的心得哦

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。