Try something like this to get an array of files that fit your pattern:
string[] files = Directory.GetFiles(
DirectoryPath,
String.Format("{0}.*", fileNameOnly));
solved multiple checks for file extension [closed]
Try something like this to get an array of files that fit your pattern:
string[] files = Directory.GetFiles(
DirectoryPath,
String.Format("{0}.*", fileNameOnly));
solved multiple checks for file extension [closed]