Set or return the security mode for the specified communications channel.
An FtpChannelMode enumeration value which specifies the current channel mode.
The ChannelMode property is used to change the default mode for the specified channel, and is typically used to control whether or not data is encrypted during a file transfer. If a standard, non-secure connection has been established with the server, an error will be returned if you specify the channelSecure mode for either channel.
If you have established a secure connection and then specify the channelClear mode for the command channel, the client will send the CCC command to the server to indicate that commands should no longer be encrypted. If the server does not support this command, an error will be returned and the channel mode will remain unchanged. Once the command channel has been changed to clear mode, it cannot be changed back to secure mode. You must disconnect and re-connect to the server if you want to resume sending commands over an encrypted channel.
Changing the mode for the data channel requires that the server support the PROT command. If this command is not supported by the server, an exception will be thrown which must be handled by the application. You can only set a channel to secure mode if the Secure property is also set to true.
It is important to note that this property should only be used after a connection has been established with the server. If you attempt to read the property or change a value prior to calling the Connect method, an exception will be thrown.