I have been working on small C# project that requires me to write to file, the contents of a given folder. However, the problem I have is the order that the files are written. I need to sort the array, so that the files are ordered by the number prior to the file extension.
Example File Name Format
File name can be any length.
I have looked into using ICompare but not sure I how to use it.
Can anyone throw any light onto this subject?
Below is what I have written thus far.
string filePath = ConfigurationManager.AppSettings["FileListPath"].ToString;
string  currentDirectoryFileList = Directory.GetFiles(filepath);
using(StreamWriter sw = File.CreateText("C:/Test.txt")
foreach(string fileName in currentDirectoryFileList)