Can I save the buffer or contents of the console window for future use?

I enjoy console applications and just want to know. What is the best way to save the current console window buffer for later use and provide some sort of history navigation feature. I know that the Diagnostics namespace provides the ability to read standard output, but only when redirecting, so basically you have to run all your results in a new window, which seems a little dumb.

+6
source share
1 answer

You need to read the console screen buffer.

A few years ago, I wrote a series of articles about accessing the .NET console API. The article you are interested in Working with console screen buffers .

Full source code is available at http://mischel.com/pubs/consoledotnet/consoledotnet.zip .

+7
source

Source: https://habr.com/ru/post/897697/


All Articles