我希望列出给定目录的子目录,所以我使用Directory.GetDirectories(string)。“一切正常,但我看不到”。和"..“在返回数组中。那两个人不应该在那里吗?
发布于 2013-05-05 23:41:43
GetDirectories仅返回sub-directories.不是父目录,也不是当前目录。
文档:
Return Value
Type: System.String[]
An array of the full names (including paths) of subdirectories in the specified path.发布于 2013-05-05 23:48:42
假设您以Directory.GetDirectories(path);身份调用,然后
.是path和
..是new DirectoryInfo(path).Parent.FullName
https://stackoverflow.com/questions/16386102
复制相似问题