Printing in C # console window

I am trying to print 1820 lines in a C # console window. However, when printing is complete and I am viewing the console window, I see only 300 lines. What is the problem? When I write to a file, I see 1820 lines! So, I narrowed down the problem in the OUTPUT console window

+3
source share
3 answers

Adjust the buffer size for the window:

  • Click the icon in the upper left corner of the window.
  • Properties
  • Layout
  • Screen Buffer Size
  • Enter the maximum value for height: 9999

If you need more than that, you need to use a graphical interface or write to a file and view it in a text editor.

+3
source

Windows , - 300 .

( ) cmd.exe, Properties :

alt text

, , - , RAM , !

+7

You can use Console.SetBufferSize () to increase the console buffer:

class Program {
    static void Main(string[] args) {
        Console.SetBufferSize(Console.WindowWidth, 2000);
        // etc..
    }
}

- Small addition -

If you are hoping to get the maximum possible buffer:

 Console.SetBufferSize(Console.WindowWidth, Int16.MaxValue-1);

You are not allowed anything> = Int16.MaxValue

+5
source

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


All Articles