我如何跳到文件中的某些行,例如 c:\text.txt 中的第 300 行?
using (var reader = new StreamReader(@"c:\test.txt"))
{
for (int i = 0; i < 300; i++)
{
reader.ReadLine();
}
// Now you are at line 300. You may continue reading
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)