I need to decide whether file name fits to file mask. The file mask could contain * or ? characters. Is there any simple solution for this?
bool bFits = Fits
Nissim mentioned the PatternMatcher Class in his answer...
There is an explanation available here:
http://referencesource.microsoft.com/#System/services/io/system/io/PatternMatcher.cs
So you don't have to use the reflected code and guess how it works.
Also, I think using this code is probably the best solution, because it guarantees consistent behavior when using the same pattern in your comparisons and in Framework methods like GetFiles()
.