public class NameRegexSearchCondition : SearchCondition
Shows how to use the NameRegexSearchCondition class to add files with names that match a regex pattern.
using System.IO; using ComponentPro.Net; using ComponentPro.IO; ... // Create a new instance of the Ftp class. Ftp client = new Ftp(); // Connect to the server client.Connect("demo.componentpro.com"); // Authenticate. client.Authenticate("test", "test"); // Use regex pattern. client.Upload(@"C:\Test", "/", new NameRegexSearchCondition(@"\d\sFile\.exe")); // Close the connection. client.Disconnect();
Shows how to use the NameRegexSearchCondition class to add files with names that match a regex pattern.
using System.IO; using ComponentPro.Net; using ComponentPro.IO; ... // Create a new instance of the Sftp class. Sftp client = new Sftp(); // Connect to the server client.Connect("demo.componentpro.com"); // Authenticate. client.Authenticate("test", "test"); // Use regex pattern. client.Upload(@"C:\Test", "/", new NameRegexSearchCondition(@"\d\sFile\.exe")); // Close the connection. client.Disconnect();
Shows how to use the NameRegexSearchCondition class to add files with names that match a regex pattern.
using ComponentPro.Compression; using ComponentPro.IO; ... // Create a new instance of the Zip class. using (Zip arc = new Zip()) { // Create a new zip file. arc.Create("test.zip"); TransferOptions opt = new TransferOptions(); // Use regex pattern. opt.SearchCondition = new NameRegexSearchCondition(@"\d\sFile\.exe"); arc.AddFiles(@"C:\Test", "/", opt); }