我有这个流媒体阅读器:
Boolean read = false;
while (wline!="exit")
{
while (!read || streamReader.Peek() >= 0)
{
read = true;
Console.Write((char)streamReader.Read());
}
wline = Console.ReadLine();
streamWriter.Write(wline+"\r\n");
streamWriter.Flush();
}
如何为 Read() 方法设置超时?谢谢