BTVisualFTP 3.0

TBTVisualFTP Class Reference

Provides the main component. More...

List of all members.

Public Member Functions

 TBTVisualFTP (TComponent AOwner)
 Constructor.
 ~TBTVisualFTP ()
 Destructor.
 Loaded ()
 Loaded.
 MyOnLog (TObject Sender, const TLogLevel LogLevel, const string LogText)
 The FtpLogger logging method, this method is public so you can add it to your own logging method.
Boolean Connect ()
 Connect to the remote server.
Boolean Connected ()
 Checks if there is an active Ftp connection.
 Disconnect ()
 Disconnect from the remote server.

Public Attributes

TActionList FtpActionList
 The internal ActionList of the popup menu.
Boolean Busy
 This property is True if file transfer is in progress.
TIdFtp Ftp
 The Internet Direct (Indy) FTP component.
TFtpPrivileges FtpClientPrivileges
 FTP client rights.
TStrings FtpHistory
 A list of directories which have been visited.
TLogger FtpLogger
 Provides logging methods.
TOptionsBehaviour FtpOptionsBehaviour
 Controls the behaviour of the component.
TOptionsView FtpOptionsView
 View options.
string FtpRemoteDir
 Initial remote server directory.
string FtpVersion
 The component version.
TNotifyEvent OnChange
 Event which will be called after changes.
TNotifyEvent OnAfterChangeDir
 Event which will be called after a Cwd.
TNotifyEvent OnConnect
 Event which will be called after a successful Connect.
TNotifyEvent OnDisconnect
 Event which will be called after Disconnect.
TNotifyEvent OnDownloadComplete
 Event which will be called after a download.
TFtpProgressEvent OnFileProgress
 Event which can be used to display the transfer progress for the current file.
TFtpProgressEvent OnFilesProgress
 Event which can be used to display current and total number of files.
TGetLocalFileEvent OnGetLocalFile
 Event which will be called to get a local file name.
TNotifyEvent OnUploadComplete
 Event which will be called after a upload.

Detailed Description

Provides the main component.

See also:
TFtpPrivileges
TLogLevel
TOptionsBehaviour
TOptionsView
Todo:
cancel transfer using key or menu item.

Member Function Documentation

Boolean TBTVisualFTP::Connect ( )

Connect to the remote server.

  1. if there is an open connection, disconnect
  2. check if Host and Username properties are not empty
  3. checks if Password is empty, if yes, ask for it (using an InputQuery)
  4. connects to the server
  5. changes to the directory specified in the FtpRemoteDir property
  6. refreshes the view
  7. calls the custom OnConnect event handler (if it is assigned and the connection is opened)
Returns:
True if a connection has been esablished.
Exceptions:
IfHost property is empty
IfUsername property is empty
See also:
OnConnect
Boolean TBTVisualFTP::Connected ( )

Checks if there is an active Ftp connection.

Returns:
True if there is a connection.
TBTVisualFTP::Disconnect ( )

Disconnect from the remote server.

This method also calls the OnDisconnect event handler.

TBTVisualFTP::Loaded ( )

Loaded.

Exceptions:
Ifthe IdFTP component is not assigned.
TBTVisualFTP::MyOnLog ( TObject  Sender,
const TLogLevel  LogLevel,
const string  LogText 
)

The FtpLogger logging method, this method is public so you can add it to your own logging method.

The following example shows a custom log event handler, which also uses a statusbar to display the log message:

 procedure TForm1.BTVisualFTP1Log(Sender: TObject;
   const LogLevel: TLogLevel; const LogMessage: string);
 begin
   BTVisualFTP1.MyOnLog(Sender, LogLevel, LogMessage);
   Statusbar1.SimpleText := LogMessage;
 end;

Member Data Documentation

This property is True if file transfer is in progress.

See also:
FBusy For reading
SetBusy For writing

The Internet Direct (Indy) FTP component.

See also:
GetIdFTP For reading
SetIdFTP For writing

This property has to be assigned to a Indy FTP client component.

The internal ActionList of the popup menu.

See also:
FFtpActionList For reading

Allows to set properties of the internal popup menu.

Note:
this is a read-only property

FTP client rights.

See also:
FFtpPrivileges For reading
SetFtpClientPrivileges For writing

A list of directories which have been visited.

See also:
GetFtpHistory For reading
SetFtpHistory For writing

Provides logging methods.

See also:
GetLogger For reading
SetLogger For writing

Controls the behaviour of the component.

See also:
FFtpOptionsBehaviour For reading
FFtpOptionsBehaviour For writing

View options.

See also:
FFtpOptionsView For reading
FFtpOptionsView For writing

Initial remote server directory.

See also:
GetRemoteDir For reading
SetRemoteDir For writing
TBTVisualFTP.Connect

The component version.

See also:
GetVersion For reading
False For writing

Event which will be called after a Cwd.

See also:
FOnAfterChangeDir For reading
FOnAfterChangeDir For writing

Event which will be called after changes.

See also:
FOnChange For reading
FOnChange For writing

Event which will be called after a successful Connect.

See also:
FOnConnect For reading
FOnConnect For writing

Event which will be called after Disconnect.

See also:
FOnDisconnect For reading
FOnDisconnect For writing

Event which will be called after a download.

See also:
FOnDownloadComplete For reading
FOnDownloadComplete For writing

This event will be called even if the download was not successful.

Event which can be used to display the transfer progress for the current file.

See also:
FOnFileProgress For reading
FOnFileProgress For writing

Event which can be used to display current and total number of files.

See also:
FOnFilesProgress For reading
FOnFilesProgress For writing

Event which will be called to get a local file name.

See also:
FOnGetLocalFile For reading
FOnGetLocalFile For writing

If no custom code is assigned to this event handler, a standard SaveDialog will be opened.

Event which will be called after a upload.

See also:
FOnUploadComplete For reading
FOnUploadComplete For writing
 All Classes Files Functions Variables Typedefs Enumerations