Disabling input in C# Console until certain task is completed

后端 未结 2 1184
独厮守ぢ
独厮守ぢ 2020-12-02 02:35

I\'m working on a little part of my program, handling the input, basically I have this little code:

bool Done = false;
while (!Done)
{
  ConsoleKeyInfo key =         


        
2条回答
  •  时光说笑
    2020-12-02 02:52

    You can not block input, Even if you do not process it, it goes to the keyboard buffer.

    You can simply stop getting them out of the buffer though.

提交回复
热议问题