Dart Ftp Control
State Event
Description
Fires when the State property changes.
Syntax
Visual Basic
Public Event State()
Remarks

WARNING Timeout must be 0 when calling methods from within an event. Failure to observe this rule may cause reentrancy problems and unpredictable results.

The Login method (used to initiate an active connection) normally causes the State property to transition from tcpClosed to tcpConnecting (while resources are being allocated and the connection is being established) to tcpConnected, at which time communications activity can start.

The Logout method normally causes the State property to transition from tcpConnected to tcpClosing (while resources are being de-allocated) to tcpClosed.

Example
Private Sub Ftp1_State()
	On Error Goto OnError ' use intrinsic error handling
	' State of the Telnet1 connection has changed...put up user feedback
	Select Case Ftp1.State
	Case tcpConnecting
		Label1.Caption = "Client Connecting..."
	Case tcpConnected
		Label2.Caption = "Client Connected to " & Tcp1.RemoteAddress
	Case tcpClosing
		Label3.Caption = "Client Closing..."
	Case tcpClosed
		Label4.Caption = "Client Closed"
	End Select
	Exit Sub
OnError: ' Any error jumps here
	Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description
End Sub
See Also

Ftp Object  | Ftp Members


PowerTCP SSL for ActiveX Documentation Version 2.2.1
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic