C# winform中如何获取路径下的文件夹名?

2024-11-20 07:00:14
推荐回答(4个)
回答1:

using System.IO;

String[] dirs = Directory.GetDirectories(@"C:\");
comboBox1.Items.AddRange(dirs);

回答2:

using System.IO;
String[] dirs = Directory.GetDirectories(@"C:\");
comboBox1.Items.AddRange(dirs);

回答3:

Directory.GetDirectories(filePath)

回答4:

System.IO.Directory.CreateDirectory("c:\\").GetDirectories()