S
Shmulik
How can I (can I?) use a regular expression as the filter to a
FileSystemWatcher?
I want to watch for something like this:
Regex regex = new Regex(@"^Current(One|Two|Three)File\.txt$",
RegexOptions.IgnoreCase);
That is, is the file CurrentOneFile.txt, CurrentTwoFile.txt, etc. shows in
in the directory I'm watching, then I can take action.
I can't assign the regex to the filter though:
FileSystemWatcher fsw = new FileSystemWatcher ();
fsw.Filter = regex; // won't work
How can I accomplish this?
TIA
FileSystemWatcher?
I want to watch for something like this:
Regex regex = new Regex(@"^Current(One|Two|Three)File\.txt$",
RegexOptions.IgnoreCase);
That is, is the file CurrentOneFile.txt, CurrentTwoFile.txt, etc. shows in
in the directory I'm watching, then I can take action.
I can't assign the regex to the filter though:
FileSystemWatcher fsw = new FileSystemWatcher ();
fsw.Filter = regex; // won't work
How can I accomplish this?
TIA