|
-
Jul 28th, 2011, 06:50 AM
#1
Thread Starter
Fanatic Member
Help in Var Sorting
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..
Last edited by vijy; Jul 28th, 2011 at 07:08 AM.
Visual Studio.net 2010
If this post is useful, rate it

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|