Hello to all!

The question arose how to make it so that when writing !clear to the console there was any action. For example: I entered any text into the console and wrote! Clear and the console was cleared.

  • intercept keystrokes and analyze the entered text. if a command is found, perform the operation in accordance with the logic. - vv2cc

1 answer 1

You guys are already abandoning elementary thoughts! It is necessary to think with your brain even occasionally ...

 string read_buffer = Console.ReadLine(); if(read_buffer=="!console") { Console.Clear(); } 
  • 3
    IOException: > Attempting to an IOException: will still be correct. Clear method in a try…catch block. - Costantino Rupert
  • one
    @ Kotik_hochet_kusat, well, I think, if you start to fasten all sorts of features here, you get a whole micro system =) - Salivan