DirectoryInfo TheFolder=new DirectoryInfo("c:\\");
foreach(DirectoryInfo NextFolder in TheFolder.GetDirectories()) this.listBox1.Items.Add(NextFolder.Name); foreach(FileInfo NextFile in TheFolder.GetFiles()) this.listBox2.Items.Add(NextFile.Name);本文共 247 字,大约阅读时间需要 1 分钟。
DirectoryInfo TheFolder=new DirectoryInfo("c:\\");
foreach(DirectoryInfo NextFolder in TheFolder.GetDirectories()) this.listBox1.Items.Add(NextFolder.Name); foreach(FileInfo NextFile in TheFolder.GetFiles()) this.listBox2.Items.Add(NextFile.Name);转载地址:http://hkiva.baihongyu.com/