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

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

java - Why is BlockingQueue.take() not releasing the thread? -

jQuery Ajax Render Fragments OR Whole Page -