ComponentPro UltimateSftp

      Make a trace log

      Language Filter: AllSend comments on this topic to ComponentPro

      When you want to log commands sent to the server and the corresponding responses, use the following useful events:

      Event name Description
      CommandResponse Occurs when a command is sent to the server or a response is received from the server.
      Progress Occurs when data is sent or received. It can be used by a GUI application to display a progress bar.

      The example below shows you how to handle the CommandResponse event to log commands sent to the server and responses:

      using System;
      using ComponentPro.Net;
      static void Main()
          // Create a new class instance. 
          Scp client = new Scp();
          client.CommandResponse += client_CommandResponse;
          // Connect to the SCP server. 
          // Authenticate. 
          client.Authenticate("test", "test");
          // ... 
          // Do something here 
          // ... 
          // Disconnect. 
      static void client_CommandResponse(object sender, CommandResponseEventArgs e)
          if (e.Command != null)
              Console.WriteLine("CMD>       " + e.Command);
              Console.WriteLine("RESPONSE>  " + e.Response);