C#可将中控台溢出太多Writelines?

编程入门 行业动态 更新时间:2024-10-09 13:25:07
本文介绍了C#可将中控台溢出太多Writelines?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如果我有执行每第二个Console.WriteLine多次,并且程序左运行的很长一段时间的程序,可以与太多行控制台溢出?我只是想知道,如果它最终将抛出一个IO异常,或者Console.Writelines的数量实际上是无限的。

If I have a program that performs Console.Writeline multiple times per second, and the program is left running for a long period of time, can the console overflow with too many lines? I just want to know if it will eventually throw an IO exception or if number of Console.Writelines is virtually infinite.

推荐答案

没有,它不会溢出。如果检查的选项的选项卡的快捷方式,命令窗口,你会看到一个的缓冲区大小的选项。这指定了将被存储的行的最大数量。旧的被删除。

No, it won't overflow. If you check the Options tab for a shortcut to the command window you will see a buffer size option. This specifies the maximum number of lines that will be stored. Older ones get deleted.

正如Scott指出在下面他的意见,您可以访问使用从您的代码此设置的 Console.BufferHeight 。它的默认值(当我在我的开发PC上测试)是的 300 。最大允许值为 32766 ( Int16.MaxValue - 1 )。

As Scott suggests in his comment below, you can access this setting from your code using Console.BufferHeight. The default value for this (when I tested on my development PC) is 300. The maximum allowed value is 32766 (Int16.MaxValue - 1).

更多推荐

C#可将中控台溢出太多Writelines?

本文发布于:2023-11-29 06:04:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1645551.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:太多   可将   中控台   Writelines

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!