Command Method

Specify a command to execute on a FTP server.

Syntax

object.Command( Command )

The object placeholder represents an expression that evaluates to a FileTransfer object.

Return Type

Integer

Remarks

Invoking the Command method causes the specified command to be executed on the server. This allows the application to take advantage of extended commands that are not directly available through the control. The ResultCode property should be checked to determine if the command was successful or not.

A value of zero is returned if the operation was successful, otherwise a non-zero error code is returned which indicates the cause of the failure.

Example

Dim nError As Long

' Report current status of the server
nError = FileTransfer1.Command("STAT")

If nError <> 0 Then
    MsgBox "Command error: " & nError
Else
    MsgBox FileTransfer1.ResultCode & ": " & FileTransfer1.ResultString
End If

See Also

ResultCode Property, ResultString Property, OnCommand Event


Copyright © 2008 Catalyst Development Corporation. All rights reserved.