📜  c# 逐行读取文件 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:39.148000             🧑  作者: Mango

代码示例2
string GetLine(string fileName, int line)
{
   using (var sr = new StreamReader(fileName)) {
       for (int i = 1; i < line; i++)
          sr.ReadLine();
       return sr.ReadLine();
   }
}