C#逐行读取文本文件到字符串列表的代码
List<string> lines = new List<string>(); using (StreamReader r = new StreamReader("databasefile.txt")) { string line; while ((line = r.ReadLine()) != null) { lines.Add(line); } r.Close(); }
C#逐行读取文本文件到字符串列表的代码
List<string> lines = new List<string>(); using (StreamReader r = new StreamReader("databasefile.txt")) { string line; while ((line = r.ReadLine()) != null) { lines.Add(line); } r.Close(); }