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
Use WildCardPattern class from System.Management.Automation available as NuGet package or in Windows PowerShell SDK.
System.Management.Automation
WildcardPattern pattern = new WildcardPattern("my*.txt"); bool fits = pattern.IsMatch("myfile.txt");