Now I have a directory with bunch files with format of name like "EXT2-401-B-140422-1540-1542.mp4", within which the "140422" part indicates the date. Now assume that this bunch of files have the dates like 140421, 140422, 140423...(for every date there are couple of files). Now I shall sort these files according to their dates, so I'd like to know how could I get these names (140421,140422,etc). I tried like this:
directory = new DirectoryInfo(camera_dir);
string[] date = new string[directory.GetFiles().Length];
foreach (FileInfo file in directory.GetFiles())
{
foreach(string name in date)
{
name = file.Name.Substring(11, 6);
}
}
And the error message is that I can't assign to name. So anybody could help?