c# - How to return the newest file in a directory as a string? -


i able return newest item (that has been created) string within program

e.g. s = test.txt

the "download" directory

text.txt date created 4/5/2011 something.txt date created 1/1/2011 

string res = directory.enumeratefiles(direcory)     .orderbydescending(f => new fileinfo(f).creationtime).firstordefault(); 

Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -