i am practising Linq samples from ..MSDN
I struck with a thing.
Am trying to get files from a directory.
The file names in the folder are 1.rtf,2.rtf,3.rtf.....10.rtf...., 20.rtf...,, 30.rtf
C# Code Code:
try { var ofileLst = from n in Directory.GetFiles(@"C:\Users\is1828\Desktop\OCR Data") where Path.GetExtension(n).Equals(".rtf") select n; foreach (var fil in ofileLst) { } } catch (Exception e) { }
i neeed to sort th ofileLst on the basis of filename.
because when looping, 1.rtf.10.rtf,.... 20.rtf,..
but i need to get file in the sorted way..
