Gets the list of files and directories that have been processed or being processed, or a null reference if RetainFileList is false (to reduce memory footprint while transferring multiple files by default). See example code of this property to know how to access the file list.

      Syntax

      public ProgressFileList FileList { get; set; }

      Value

      The files added to the queue if RetainFileList is true; otherwise, null.

      Remarks

      By default, RetainFileList is set to false to reduce memory footprint while executing multi-file operations, making this property always returns a null reference. Set RetainFileList to true to retrieve the list of files and directories.

      Examples

      FTP Examples

      Shows how to use the FileList property.

      using System;
      using ComponentPro.IO;
      using ComponentPro.Net;
      
      ...
      
      // Create a new Ftp instance.
      Ftp client = new Ftp();
      
      // Connect to the FTP server.
      client.Connect("demo.componentpro.com");
      
      // Authenticate.
      client.Authenticate("test", "test");
      
      try
      {
          TransferOptions opt = new TransferOptions();
          opt.RetainFileList = true; // Retain FileList property so that we can use it later. 
       
          // Upload files and directories from "C:\Temp" to "/Temp" 
          FileSystemTransferStatistics stat = client.Upload("C:\\Temp", "/Temp", opt);
      
          Console.WriteLine("Upload - Processed files:");
      
          // stat.FileList contains information of processed files and directories when opt.RetainFileList is true; otherwise stat.FileList is null. 
          // Display processed files. 
          foreach (ProgressFileItem item in stat.FileList)
          {
              Console.WriteLine(item.SourceFileInfo.FullName + " - " + item.State.ToString());
          }
      
          // It can also be used in Delete method. 
          stat = client.Delete("/Temp", false, null, true, opt);
      
          Console.WriteLine("Delete - Processed files:");
          
          // Display processed files. 
          foreach (ProgressFileItem item in stat.FileList)
          {
              Console.WriteLine(item.SourceFileInfo.FullName + " - " + item.State.ToString());
          }
      }
      catch (Exception exc)
      {
          Console.WriteLine("Exception: " + exc.Message);
      }
      
      // Disconnect.
      client.Disconnect();

      SFTP Examples

      Shows how to use the FileList property.

      using System;
      using ComponentPro.IO;
      using ComponentPro.Net;
      
      ...
      
      // Create a new Sftp instance.
      Sftp client = new Sftp();
      
      // Connect to the SFTP server.
      client.Connect("demo.componentpro.com");
      
      // Authenticate.
      client.Authenticate("test", "test");
      
      try
      {
          TransferOptions opt = new TransferOptions();
          opt.RetainFileList = true; // Retain FileList property so that we can use it later. 
       
          // Upload files and directories from "C:\Temp" to "/Temp" 
          FileSystemTransferStatistics stat = client.Upload("C:\\Temp", "/Temp", opt);
      
          Console.WriteLine("Upload - Processed files:");
      
          // stat.FileList contains information of processed files and directories when opt.RetainFileList is true; otherwise stat.FileList is null. 
          // Display processed files. 
          foreach (ProgressFileItem item in stat.FileList)
          {
              Console.WriteLine(item.SourceFileInfo.FullName + " - " + item.State.ToString());
          }
      
          // It can also be used in Delete method. 
          stat = client.Delete("/Temp", false, null, true, opt);
      
          Console.WriteLine("Delete - Processed files:");
          
          // Display processed files. 
          foreach (ProgressFileItem item in stat.FileList)
          {
              Console.WriteLine(item.SourceFileInfo.FullName + " - " + item.State.ToString());
          }
      }
      catch (Exception exc)
      {
          Console.WriteLine("Exception: " + exc.Message);
      }
      
      // Disconnect.
      client.Disconnect();

      ZIP Examples

      Shows how to use the FileList property.

      using System;
      using ComponentPro.IO;
      using ComponentPro.Compression;
      
      ...
      
      // Create a new instance.
      Zip zip = new Zip();
      // Create a new zip file.
      zip.Create("test.zip");
      
      try
      {
          TransferOptions opt = new TransferOptions();
          opt.RetainFileList = true; // Retain FileList property so that we can use it later. 
       
          // Add files and directories from "C:\Temp" to "/Temp" 
          FileSystemTransferStatistics stat = zip.AddFiles("C:\\Temp", "/Temp", opt);
      
          Console.WriteLine("UploadFiles - Processed files:");
      
          // stat.FileList contains information of processed files and directories when opt.RetainFileList is true; otherwise stat.FileList is null. 
          // Display processed files. 
          foreach (ProgressFileItem item in stat.FileList)
          {
              Console.WriteLine(item.SourceFileInfo.FullName + " - " + item.State.ToString());
          }
      
          // It can also be used in DeleteFiles method. 
          stat = zip.Delete("/Temp", false, null, true, opt);
      
          Console.WriteLine("DeleteFiles - Processed files:");
      
          // Display processed files. 
          foreach (ProgressFileItem item in stat.FileList)
          {
              Console.WriteLine(item.SourceFileInfo.FullName + " - " + item.State.ToString());
          }
      }
      catch (Exception exc)
      {
          Console.WriteLine("Exception: " + exc.Message);
      }
      
      // Close.
      zip.Close();

      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)

      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.FileSystem.WinPcl (in ComponentPro.FileSystem.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.FileSystem.Uwp (in ComponentPro.FileSystem.Uwp.dll)

      Xamarin AndroidXamarin Android

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

      Xamarin MacXamarin Mac

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

      Xamarin iOSXamarin iOS

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

      See Also