我需要的子目录列表,在订购CreationDate目录 .NET 3.0
I need to get list of sub-directories from a directory ordered by CreationDate in .Net 3.0
您应该能够使用 DirectoryInfo的类本(需要.NET 4):
You should be able to use the DirectoryInfo class for this (requires .NET 4):
var di = new DirectoryInfo(theFolder);
var directories = di.EnumerateDirectories()
.OrderBy(d => d.CreationTime)
.Select(d => d.Name)
.ToList();
在.NET 3.0中,你可以使用DirectoryInfo.GetDirectories,然后再把用同样的逻辑排序的数组。
In .NET 3.0, you could use DirectoryInfo.GetDirectories
, then sort the array afterwards using the same logic.