CFtpServer::GetCommandName Method  
 
INT GetCommandName
  UINT nClientId,  
  LPTSTR lpszCommand,  
  INT nMaxLength  
);
INT GetCommandName
  UINT nClientId,  
  CString& strCommand  
);

Return the name of the last command issued by the client.

Parameters

nClientId
An unsigned integer which uniquely identifies the client session.
lpszCommand
A pointer to a string buffer that will contain the command name. The string buffer will be null terminated and must be large enough to store the complete command name. If this parameter is NULL, the method will only return the length of the current command in characters, not including the terminating null character. An alternate version of this method accepts a CString object if it is available.
nMaxLength
An integer value that specifies the maximum number of characters that can be copied into the string buffer, including the terminating null character. If the maximum length specified is smaller than the actual length of the parameter, this method will fail. If the lpszCommand parameter is NULL, this value should be zero.

Return Value

An integer value which specifies the number of characters copied into the buffer, not including the terminating null character. If the method fails, the return value will be zero and the GetLastError method can be used to retrieve the last error code. If the last error code is returned as a value of zero, this means that no command has been issued by the client.

Remarks

The GetCommandName method is used to obtain the name of the last command that was issued by the client. The command name returned by this method will always be capitalized, regardless of how it was sent by the client. This method is typically used inside the OnCommand and OnResult event handlers to pre-process and post-process client commands, respectively.

The GetCommandParam method can be used to return the value of individual command parameters specified by the client. The GetComandLine method can be used to obtain the complete command line issued by the client.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csftsv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

GetCommandFile, GetCommandLine, GetCommandParam, OnCommand, OnResult