SocketTools .NET Edition

FtpClient.Features Property

Gets and sets the features that are currently enabled for the current session.

[Visual Basic]
Public Property Features As FtpFeatures
[C#]
public FtpClient.FtpFeatures Features {get; set;}

Property Value

An FtpFeatures enumeration which specifies the features that are available for the current client session.

Remarks

When a client connection is first established, all features are enabled by default. However, as the client issues commands to the server, if the server reports that the command is unrecognized that feature will automatically be disabled in the client.

For example, the first time an application calls the GetFileSize method to determine the size of a file, the control will try to use the SIZE command. If the server reports that the SIZE command is not available, that feature will be disabled and the control will not use the command again during the session unless it is explicitly re-enabled. This is designed to prevent the control from repeatedly sending invalid commands to a server, which may result in the server aborting the connection.

Setting the Features property enables those features which have been specified. More than one feature may be enabled by combining the above constants using a bitwise Or operator. To test if a particular feature has been enabled, use the bitwise And operator.

Because features are specific to the current session, once you disconnect from the server they are reset. Even if you wish to reconnect to the same server, you must explicitly set the Features property again to those features which you wish to enable. Setting the Features property when the control is not connected to a server will cause the client session to only use those specified features for the next connection that is established. Setting the Features property during an active connection will change the features available for that session.

See Also

FtpClient Class | SocketTools Namespace