string x = txtpath.Text;
DirectoryInfo theFolder = new DirectoryInfo(x);
FileInfo[] fileInfo = theFolder.GetFiles();
foreach (FileInfo NextFile in fileInfo) //遍历文件 { var filename = NextFile.Name;
}
转载于:https://www.cnblogs.com/ft-Pavilion/p/4737603.html