【发布时间】:2015-01-03 20:48:02
【问题描述】:
我正在慢慢尝试使用所有开源工具,但似乎我已经对使用 .net 框架感到非常厌烦。
我了解 Mono 是 .Net 的开源替代品,但我将 MinGW 与 CodeBlocks 一起使用。不确定是否可以在 CodeBlocks 中使用 Mono,所以我想知道是否有另一个可以工作的 MingW 友好库像 StreamReader?就像现代版本的 FILE *fopen。
using (TextReader tr = new StreamReader(new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
{
string line;
while ((line = tr.ReadLine()) != null)
{
// Do work here
}
}
【问题讨论】: