第1个回答 2017-07-22
using System.IO;
string path = @"D:/test";
DirectoryInfo dinfo = new DirectoryInfo(path);
string[] temp = null;
if (dinfo.Exists)
{
FileInfo[] finfo= dinfo.GetFiles();
temp=new string[finfo.Length];
for (int i = 0; i < finfo.Length; i++)
temp[i] = finfo[i].Name;
}本回答被网友采纳