我是C#的新手,我已经开始使用StreamReader。我试图一次读取一个文件一行,并在它与特定关键字(如“I/RPTGEN”)匹配时输出该行。到目前为止,我已经弄清楚了如何将整个文件读入一个字符串,但我无法弄清楚如何一次只读一行。到目前为止我的代码是这样的。usingSystem;usingSystem.IO;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;namespaceConsoleApplication5{classTest{public