Picture Viewer.
-
So I'm using this command to open a picture in C sharp Process.Start(@"C:\MyPicture.jpg"); Is there anyway I can open the latest picture in the folder?
-
So I'm using this command to open a picture in C sharp Process.Start(@"C:\MyPicture.jpg"); Is there anyway I can open the latest picture in the folder?
Yes. You could iterate over all the picture files in the directory, looking at the file attributes for the files. That should help you find the latest.
-
So I'm using this command to open a picture in C sharp Process.Start(@"C:\MyPicture.jpg"); Is there anyway I can open the latest picture in the folder?
var directory = new DirectoryInfo(@"C:\");
var latest = (from f in directory.EnumerateFiles("*.jpg")
orderby f.CreationTime
select f.FullName).LastOrDefault();Console.WriteLine(latest);
Returns null in case there are no jpg files found.