【发布时间】:2010-11-16 09:24:34
【问题描述】:
我想在 streamReader 中解析用户输入。我的代码是:
string txt = txtin.text ; //<~~ txtin is something like root:x:1:1....
using (TextReader reader = new TextReader( txt))
{
string line = "";
while ((line = reader.ReadLine()) != null)
{
string userName = line.Substring(0, line.IndexOf(':'));
}
}
我收到此错误:
无法创建抽象类或接口“System.IO.TextReader”的实例
【问题讨论】: