WPF中怎么遍历文件夹中的所有图片然后显示出来
WPF中怎么遍历文件夹中的所有图片然后显示出来
[解决办法]
public static void DeleteFolder(string dir) { if (System.IO.Directory.Exists(dir)) //如果存在这个文件夹删除之 { foreach (string d in System.IO.Directory.GetFileSystemEntries(dir)) { if (System.IO.File.Exists(d)) System.IO.File.Delete(d); //直接删除其中的文件 else DeleteFolder(d); //递归删除子文件夹 } System.IO.Directory.Delete(dir); //删除已空文件夹 } }
[解决办法]