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

jQuery Ajax Render Fragments OR Whole Page -

php - pass fpassthru contents to variable -

ASP.NET Javascript: window.open won't work twice -