|
Summary
Notifies that the FTP connection has been established.
Description
The OnConnect event occurs in response to the Connect method (or in response to setting the Action property to ACTION_CONNECT). This event occurs immediately after the Connect method is
called (or the Action property is set to ACTION_CONNECT) .and before the next line of code immediately following is executed.
Normally, an application should simply set a flag in response to this event. Then, this flag can be checked directly after the ACTION_CONNECT action (or the Connect method) to make sure that the
connection was actually established.
If the connection could not be established, then the OnError event will be called instead of the OnConnect event.
While handling the OnConnect event, an application should not perform tasks, which have the potential of requiring a lot of time to complete, such as generating a message box.
Example
Sub FTPClient_OnConnect () Connected = False
FTPClient.Connect ("speedy.distinct.com", "santa", "north pole", "") If Connect = False Then MsgBox "Unable to connect to server", 64, "Sample Program"
End If
End Sub
Note
A file transfer cannot be initiated in this event.
|