public bool SearchConditionCombinedWithMasksInSourcePath { get; set; }
true
.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.
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();
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();
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();