if (System.IO.Directory.Exists("D:/notes")) { String[] year = Directory.GetDirectories("D:/notes/"); String[] file = Directory.GetFiles("D:/notes/");}
本文介绍了一个简单的代码片段,用于检查指定目录是否存在,并列出该目录下的所有子目录和文件。通过使用System.IO命名空间下的Directory类,可以实现对D盘下notes目录的检查和文件罗列。
if (System.IO.Directory.Exists("D:/notes")) { String[] year = Directory.GetDirectories("D:/notes/"); String[] file = Directory.GetFiles("D:/notes/");}
转载于:https://www.cnblogs.com/Asa-Zhu/archive/2012/11/08/2761661.html
2037

被折叠的 条评论
为什么被折叠?
