ComponentPro UltimateFtp

      SearchConditionCombinedWithMasksInSourcePath Property

      See AlsoMembers Options: Show AllLanguage Filter: AllSend comments on this topic to ComponentPro
      Gets or sets a boolean value indicating whether to combine (AND logical operator) the wildcard masks found in the source path method parameter with the SearchCondition property in this transfer option object.

      Syntax

      public bool SearchConditionCombinedWithMasksInSourcePath { get; set; }

      Value

      The default value is true.

      Remarks

      If the source path does not contain wildcard masks, this field is ignored.

      If the source path contains wildcard masks, and this field is set to true, then the AND logical operator is used; otherwise, if this field is set to false, the OR logical operator is used. For example, in a call to the Delete, you specify "C:\temp\*.tmp" as the source path and your SearchCondition is AttributeSearchCondition(FileAttributes.Hidden). If this field is true, the FileSystem will search for all hidden files with .tmp extensions; false means the FileSystem will search for files with .tmp extensions or with hidden attributes.

      Examples

      FTP Examples

      Shows how to use Upload method and TransferOptions.SearchConditionCombinedWithMasksInSourcePath setting to upload files with custom search conditions.

      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");
      
      // ... 
       
      // Upload *.cs and *.vb files that smaller than 50kb from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
      TransferOptions opt = new TransferOptions();
      opt.SearchConditionCombinedWithMasksInSourcePath = true;
      
      // You can use this:
      opt.SearchCondition = new SizeSearchCondition(0, 50 * 1024);
      client.Upload("c:\\myfolder2\\*.cs;*.vb", "/myfolder2", opt);
      
      // Or this
      opt.SearchCondition = new SizeSearchCondition(0, 50 * 1024) + new NameSearchCondition("*.cs;*.vb");
      client.Upload("c:\\myfolder2", "/myfolder2", opt);
      
      // ... 
       
      // Disconnect.
      client.Disconnect();

      SFTP Examples

      Shows how to use Upload method and TransferOptions.SearchConditionCombinedWithMasksInSourcePath setting to upload files with custom search conditions.

      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");
      
      // ... 
       
      // Upload *.cs and *.vb files that smaller than 50kb from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
      TransferOptions opt = new TransferOptions();
      opt.SearchConditionCombinedWithMasksInSourcePath = true;
      
      // You can use this:
      opt.SearchCondition = new SizeSearchCondition(0, 50 * 1024);
      client.Upload("c:\\myfolder2\\*.cs;*.vb", "/myfolder2", opt);
      
      // Or this
      opt.SearchCondition = new SizeSearchCondition(0, 50 * 1024) + new NameSearchCondition("*.cs;*.vb");
      client.Upload("c:\\myfolder2", "/myfolder2", opt);
      
      // ... 
       
      // Disconnect.
      client.Disconnect();

      ZIP Examples

      Shows how to use AddFiles method and TransferOptions.SearchConditionCombinedWithMasksInSourcePath setting to add files with custom search conditions.

      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");
      
      // ... 
       
      // Add *.cs and *.vb files that smaller than 50kb from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
      TransferOptions opt = new TransferOptions();
      opt.SearchConditionCombinedWithMasksInSourcePath = true;
      
      // You can use this:
      opt.SearchCondition = new SizeSearchCondition(0, 50 * 1024);
      zip.AddFiles("c:\\myfolder2\\*.cs;*.vb", "/myfolder2", opt);
      
      // Or this
      opt.SearchCondition = new SizeSearchCondition(0, 50 * 1024) + new NameSearchCondition("*.cs;*.vb");
      zip.AddFiles("c:\\myfolder2", "/myfolder2", opt);
      
      // ... 
       
      // 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