ComponentPro UltimateZip

      FileSystemTransferStatistics Class

      See AlsoMembersMembers Options: Show AllLanguage Filter: AllSend comments on this topic to ComponentPro
      Represents the statistics of a multi-file operation.

      Syntax

      public sealed class FileSystemTransferStatistics

      Examples

      FTP Examples

      A FileSystemTransferStatistics instance returned from a multi-file operation method can be used to show the number of files and directories transferred, bytes per second, etc. The following example shows how to do so.

      using System;
      using ComponentPro.Net;
      using ComponentPro.IO;
      
      ...
      
      // Create a new class instance.
      Ftp client = new Ftp();
      
      // Connect to the FTP server.
      client.Connect("localhost");
      
      // Authenticate.
      client.Authenticate("test", "test");
      
      // ... 
       
      // Upload all files and subdirectories from local folder 'c:\temp' to the remote dir '/temp'
      FileSystemTransferStatistics statistics = client.Upload("c:\\temp", "/temp");
      
      // Show statistics
      Console.WriteLine("Total files transferred: " + statistics.FilesProcessed);
      Console.WriteLine("Total directories transferred: " + statistics.DirectoriesProcessed);
      Console.WriteLine("Total bytes transferred: " + statistics.TotalBytesTransferred);
      
      // ... 
       
      // Disconnect.
      client.Disconnect();

      SFTP Examples

      A FileSystemTransferStatistics instance returned from a multi-file operation method can be used to show the number of files and directories transferred, bytes per second, etc. The following example shows how to do so.

      using System;
      using ComponentPro.Net;
      using ComponentPro.IO;
      
      ...
      
      // Create a new class instance.
      Sftp client = new Sftp();
      
      // Connect to the SFTP server.
      client.Connect("localhost");
      
      // Authenticate.
      client.Authenticate("test", "test");
      
      // ... 
       
      // Upload all files and subdirectories from local folder 'c:\temp' to the remote dir '/temp'
      FileSystemTransferStatistics statistics = client.Upload("c:\\temp", "/temp");
      
      // Show statistics
      Console.WriteLine("Total files transferred: " + statistics.FilesProcessed);
      Console.WriteLine("Total directories transferred: " + statistics.DirectoriesProcessed);
      Console.WriteLine("Total bytes transferred: " + statistics.TotalBytesTransferred);
      
      // ... 
       
      // Disconnect.
      client.Disconnect();

      ZIP Examples

      Show transfer statistics after a call to AddFiles method.

      using System;
      using ComponentPro.Compression;
      using ComponentPro.IO;
      
      ...
      
      // Create a new instance of Zip class.
      Zip zip = new Zip();
      
      // Create a new archive.
      zip.Create("test.zip");
      
      // ... 
       
      // Add all files and subdirectories from local folder 'c:\temp' to the archive dir '/my dir'
      FileSystemTransferStatistics transferStatistics = zip.AddFiles("c:\\temp", "/my dir");
      
      // Show statistics
      Console.WriteLine("Total files transferred: " + transferStatistics.FilesProcessed);
      Console.WriteLine("Total bytes transferred: " + transferStatistics.TotalBytesTransferred);
      
      // ... 
       
      // Close.
      zip.Close();

      Inheritance Hierarchy

         ComponentPro.IO.ComponentPro.IO.FileSystemTransferStatistics

      Framework

      .NET Compact Framework.NET Compact Framework

      Supported version: 2.0, 3.5, and 3.9
      Assembly: ComponentPro.FileSystem.CF (in ComponentPro.FileSystem.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.FileSystem (in ComponentPro.FileSystem.dll)

      Xamarin AndroidXamarin Android

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

      Xamarin iOSXamarin iOS

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

      See Also