开发者

More line in console output of VS2010

开发者 https://www.devze.com 2023-02-24 09:49 出处:网络
When I run my program in VS2010, because my output quite a lot,the console just discards my previous o开发者_如何学Goutput.

When I run my program in VS2010, because my output quite a lot,the console just discards my previous o开发者_如何学Goutput.

For example, consider my output to be of 400 lines, lines 1 to 80 are not displayed, only lines 81 to 400 are displayed.

Any idea of how I can see the entire output?


You can change the buffering settings of the console: right click the title bar of the console window and select "Properties." On the "Layout" tab, change the "Height" of the Screen Buffer to some large number (9999, for example).

Run your program again.

Of course, if you have a large amount of output that you need to inspect on a regular basis, it's probably best to write to a file instead.


Console.BufferHeight = x;
Console.BufferWidth = x;

Sets the height and width of the console buffer.


Right before your output. You can set it dynamically based on output but be sure to remember that if a line is longer than the width you will have additional lines to contend with.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号