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
Post a Comment