title: Can I bypass Console.ReadKey() issue when input is redirected?
body: <p>I am a C# teacher and I wrote some automated HW checker for my students.
  The students write C# Console Applications. My HW checker is based on input redirection so I can test their code on my own generated input.</p>
  
  <p>The problem is that students sometimes end their program with a <code>Console.ReadKey()</code> instruction (They do so just to make the execution window not close when they ran the program under F5 - Debug). The <code>Console.ReadKey()</code> crashes when ran under input redirection with the following exception:</p>
  
  <blockquote>
    <p>System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file.</p>
  </blockquote>
  
  <p>Do I have any way to "bypass" this problem (without altering the students code)? Maybe tell <code>Console</code> to ignore <code>ReadKey</code> instructions?</p>