Xceed .NET Libraries Documentation
Xceed.Ftp Assembly / Xceed.Ftp Namespace / AsyncFtpClient Class / BeginSendCustomCommand(String,AsyncCallback,Object) Method
The command to send to the FTP server.
Callback method to be called when the asynchronous operation is completed.
An object containing state information for this operation.


In This Topic
    BeginSendCustomCommand(String,AsyncCallback,Object) Method
    In This Topic
    Begins the process of sending a custom command to the FTP server. Don't forget to call EndSendCustomCommand!
    Syntax
    'Declaration
     
    Public Function BeginSendCustomCommand( _
       ByVal command As String, _
       ByVal callback As AsyncCallback, _
       ByVal state As Object _
    ) As IAsyncResult
    'Usage
     
    Dim instance As AsyncFtpClient
    Dim command As String
    Dim callback As AsyncCallback
    Dim state As Object
    Dim value As IAsyncResult
     
    value = instance.BeginSendCustomCommand(command, callback, state)
    public IAsyncResult BeginSendCustomCommand( 
       string command,
       AsyncCallback callback,
       object state
    )

    Parameters

    command
    The command to send to the FTP server.
    callback
    Callback method to be called when the asynchronous operation is completed.
    state
    An object containing state information for this operation.

    Return Value

    An System.IAsyncResult representing the status of the asynchronous operation.
    Remarks

    The BeginSendCustomCommand method is used to send FTP commands. This means that commands you enter using the Windows command-line FTP (such as "dir", "put" or "debug") are not the commands that are actually sent to the FTP server. Although these commands might be recognized by some FTP servers, they are not guaranteed to work!.

    When sending a custom FTP command, the local folder separator character will not be replaced by the FtpClient.ServerFolderSeparator to allow the local folder separator character to be sent "as is".

    Not all commands are supported by all FTP servers. In order to determine which commands are supported, you can use the BeginSendCustomCommand%M:Xceed.Ftp.AsyncFtpClient.EndSendCustomCommand(System.IAsyncResult)% methods to send the "HELP" command. For example: ftp.SendCustomCommand( "HELP" );.

    The BeginSendCustomCommand method does not support custom commands that require a data connection such as STOR (BeginSendFile), RETR (BeginReceiveFile), NLST and LIST (BeginGetRawFolderContents), etc.

    When using a callback, the System.IAsyncResult is provided as a parameter. You should call EndSendCustomCommand in that callback. When NOT providing a callback, you should keep the returned IAsyncResult and call EndSendCustomCommand with it when ready to complete. In this later case, the call to EndSendCustomCommand may block until the operation completes.

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also