月光魔草

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
DirectoryInfo TheFolder=new DirectoryInfo(folderFullName);
//遍历文件夹
foreach(DirectoryInfo NextFolder in TheFolder.GetDirectories())
   this.listBox1.Items.Add(NextFolder.Name);
//遍历文件
foreach(FileInfo NextFile in TheFolder.GetFiles())
   this.listBox2.Items.Add(NextFile.Name);

 

posted on 2020-09-28 16:00  月光魔草  阅读(443)  评论(0编辑  收藏  举报