Gets or sets a boolean value indicating whether to move files from the source directory to the destination directory.

      Syntax

      public bool MoveFiles { get; set; }

      Examples

      FTP Examples

      Shows how to use Move methods and TransferOptions object to move files and directories.

      using System;
      using System.Collections.Generic;
      using System.Text;
      using ComponentPro.IO;
      using ComponentPro.Net;
      
      ...
      
      // Create a new class instance.
      Ftp client = new Ftp();
      
      // Connect to the FTP server.
      client.Connect("localhost");
      
      // Authenticate.
      client.Authenticate("test", "test");
      
      // ... 
       
      // Move all files and subdirectories from folder '/temp' to the folder '/pro'
      client.Move("/temp", "/pro");
      
      // Move all directories, subdirectories, and files that match the specified search pattern from folder '/myfolder2' to folder '/mydir2'.
      client.Move("/myfolder2", "/mydir2", "*.cs");
      
      // or you can simply put wildcard masks in the source path, our component will automatically parse it. 
      // move all *.css files from folder '/myfolder3' to folder '/mydir3'.
      client.Move("/myfolder3/*.css", "/mydir3");
      
      // Move *.cs and *.vb files from folder '/myfolder4' to folder '/mydir4'.
      client.Move("/myfolder4/*.cs;*.vb", "/mydir4");
      
      // Move all files smaller than 200kb and do not delete empty directories.
      TransferOptions opt = new TransferOptions();
      opt.DeleteEmptyDirectories = false;
      opt.SearchCondition = new SizeSearchCondition(0, 200 * 1024);
      client.Move("/myfolder5", "/mydir5", opt);
      
      // Move files on the local disk to the remote server.
      opt = new TransferOptions();
      opt.MoveFiles = true;
      client.Upload(@"c:\test", "/");
      
      // ... 
       
      // Disconnect.
      client.Disconnect();

      SFTP Examples

      Shows how to use Move methods and TransferOptions object to move files and directories.

      using System;
      using System.Collections.Generic;
      using System.Text;
      using ComponentPro.IO;
      using ComponentPro.Net;
      
      ...
      
      // Create a new class instance.
      Sftp client = new Sftp();
      
      // Connect to the SFTP server.
      client.Connect("localhost");
      
      // Authenticate.
      client.Authenticate("test", "test");
      
      // ... 
       
      // Move all files and subdirectories from folder '/temp' to the folder '/pro'
      client.Move("/temp", "/pro");
      
      // Move all directories, subdirectories, and files that match the specified search pattern from folder '/myfolder2' to folder '/mydir2'.
      client.Move("/myfolder2", "/mydir2", "*.cs");
      
      // or you can simply put wildcard masks in the source path, our component will automatically parse it. 
      // move all *.css files from folder '/myfolder3' to folder '/mydir3'.
      client.Move("/myfolder3/*.css", "/mydir3");
      
      // Move *.cs and *.vb files from folder '/myfolder4' to folder '/mydir4'.
      client.Move("/myfolder4/*.cs;*.vb", "/mydir4");
      
      // Move all files smaller than 200kb and do not delete empty directories.
      TransferOptions opt = new TransferOptions();
      opt.DeleteEmptyDirectories = false;
      opt.SearchCondition = new SizeSearchCondition(0, 200 * 1024);
      client.Move("/myfolder5", "/mydir5", opt);
      
      // Move files on the local PC to the remote server.
      opt = new TransferOptions();
      opt.MoveFiles = true;
      client.Upload(@"c:\test", "/");
      
      // ... 
       
      // Disconnect.
      client.Disconnect();

      ZIP Examples

      Shows how to use Move methods and TransferOptions object to move files and directories.

      using System;
      using System.Collections.Generic;
      using System.Text;
      using ComponentPro.IO;
      using ComponentPro.Compression;
      
      ...
      
      // Create a new instance.
      Zip zip = new Zip();
      
      // Open an existing archive.
      zip.Open("test.zip");
      
      // ... 
       
      // Move all files and subdirectories from folder '/temp' to the folder '/pro'
      zip.Move("/temp", "/pro");
      
      // Move all directories, subdirectories, and files that match the specified search pattern from folder '/myfolder2' to folder '/mydir2'.
      zip.Move("/myfolder2", "/mydir2", "*.cs");
      
      // or you can simply put wildcard masks in the source path, our component will automatically parse it. 
      // move all *.css files from folder '/myfolder3' to folder '/mydir3'.
      zip.Move("/myfolder3/*.css", "/mydir3");
      
      // Move *.cs and *.vb files from folder '/myfolder4' to folder '/mydir4'.
      zip.Move("/myfolder4/*.cs;*.vb", "/mydir4");
      
      // Move all files smaller than 200kb and do not delete empty directories.
      TransferOptions opt = new TransferOptions();
      opt.DeleteEmptyDirectories = false;
      opt.SearchCondition = new SizeSearchCondition(0, 200 * 1024);
      zip.Move("/myfolder5", "/mydir5", opt);
      
      // Move files on the local PC to the remote server.
      opt = new TransferOptions();
      opt.MoveFiles = true;
      zip.AddFiles(@"c:\test", "/");
      
      // ... 
       
      // 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