ComponentPro UltimateFtp

      ClearCommandChannel Method

      See AlsoMembers Options: Show AllLanguage Filter: AllSend comments on this topic to ComponentPro
      Clears the command channel after login to facilitate firewall NAT when connecting using a secure data channel. This method reverts the protected control connection back to plaintext connection.

      Syntax

      public void ClearCommandChannel()

      Remarks

      This method implements the FTP CCC (Clear Command Channel) command.

      This command is used in circumstances where it is desirable to protect the control connection only during authentication, when user credentials are being sent by the client.

      When the control connection is reverted to plaintext, subsequent data transfers will be protected with the current SecureDataTransfers settings.

      Examples

      Shows how to use ClearCommandChannel method.

      using System;
      using System.Collections.Generic;
      using System.Text;
      using ComponentPro;
      using ComponentPro.Net;
      
      ...
      
      // Create a new class instance.
      Ftp client = new Ftp();
      
      // Connect to the FTP server asynchronously.
      client.Connect("myserver");
      
      // Or you can specify the FTP port with 
      // client.Connect("myserver", 21); 
       
      // Authenticate the user.
      client.Authenticate("userName", "password");
      
      // ... 
       
      // Use the ClearCommandChannel to revert back to unencrypted FTP control connection  
      // after logging in (data connections can stay encrypted after this), enabling the  
      // firewall to work again in exchange for a degree of security. 
      // From now on, all data sending to the server will not be protected.
      client.ClearCommandChannel();
      
      // ... 
       
      // Disconnect.
      client.Disconnect();

      Framework

      .NET Compact Framework.NET Compact Framework

      Supported version: 2.0, 3.5, and 3.9
      Assembly: ComponentPro.Ftp.CF (in ComponentPro.Ftp.CF.dll)

      .NET Framework.NET Framework

      Supported version: 2.0, 3.0, 3.5, 4.0, 4.5.x, 4.6.x and later
      Assembly: ComponentPro.Ftp (in ComponentPro.Ftp.dll)

      Portable Class Library for Windows Phone 8.1 and Windows 8.1 Store AppsPortable Class Library for Windows Phone 8.1 and Windows 8.1 Store Apps

      Supported version: 4.6.x and later
      Assembly: ComponentPro.Ftp.WinPcl (in ComponentPro.Ftp.WinPcl.dll)

      Universal Windows Platform (includes Windows 10 Mobile, Windows 10 Store Apps and Windows 10 IoT)Universal Windows Platform (includes Windows 10 Mobile, Windows 10 Store Apps and Windows 10 IoT)

      Supported version: 4.6.x and later
      Assembly: ComponentPro.Ftp.Uwp (in ComponentPro.Ftp.Uwp.dll)

      Xamarin AndroidXamarin Android

      Supported version: 2.3 and later
      Assembly: ComponentPro.Ftp.Android (in ComponentPro.Ftp.Android.dll)

      Xamarin MacXamarin Mac

      Supported version: 2.0.x and later
      Assembly: ComponentPro.Ftp.Mac (in ComponentPro.Ftp.Mac.dll)

      Xamarin iOSXamarin iOS

      Supported version: 5.1.x and later
      Assembly: ComponentPro.Ftp.iOS (in ComponentPro.Ftp.iOS.dll)

      See Also