//获得当前文件夹下所有文件夹 string path = "D://文件夹"; string[] dirstr = Directory.GetDirectories(path); //获得当前文件夹下的文件 string[] filestr = Directory.GetFiles(path); int count = 0; for (int i = 0; i < filestr.Length; i++) { string paths = filestr[i]; StreamReader sr = new StreamReader(paths, Encoding.Default); String line; while ((line = sr.ReadLine()) != null) { //Console.WriteLine(line.ToString()); bll.Insert(line); count++; } }