0
是否有任何方法可以獲取Windows Form C#中文件夾中最後添加圖像的路徑。我陷入了這個問題。在WinForm中獲取圖像路徑
是否有任何方法可以獲取Windows Form C#中文件夾中最後添加圖像的路徑。我陷入了這個問題。在WinForm中獲取圖像路徑
試試這個,
var directory = new DirectoryInfo("C:\\your directory name");
var myFile = directory.GetFiles()
.OrderByDescending(f => f.LastWriteTime)
.First();
享受!
當您說出「添加到文件夾中的最後一張圖片」時,您實際上會明白什麼?首先,你在說什麼文件夾? – SJD 2015-04-04 18:29:10
你可以觀看文件夾的變化,看到這個http://www.codeproject.com/Articles/26528/C-Application-to-Watch-a-File-or-Directory-using-F – 2015-04-04 18:30:06
爲什麼你添加'窗口-forms-designer'到你的標籤? – TaW 2015-04-04 18:40:57