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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -