I need to get most recently created file name from a directory. I tried below thing.
DirectoryInfo dirInfo = new DirectoryInfo(@"E:\Result");
var file = dirInfo.GetFiles("PaperResult*").Select(f => f.CreationTime).First();
Console.WriteLine(file);
But it is returning me Date and Time. It is not returning the file name. What am I missing here ? Any help is appreciated.