用如下的代码:
再给你一个例子,取得c盘下所有的东西
string[] contents = Directory.GetFileSystemEntries(@"C:\"); 
 
foreach(string s in contents)
{
 
MessageBox.Show(s); 
}