若要更改控制台的BufferWidth,请使用Console.BufferWidth属性。
现在让我们看一个例子-
using System;
class Demo {
public static void Main (string[] args){
Console.BufferHeight = 200;
Console.WriteLine("Buffer Height = "+Console.BufferHeight);
Console.BufferHeight = 250;
Console.WriteLine("Buffer Width = "+Console.BufferWidth);
}
}
输出结果
这将产生以下输出-
Buffer Height = 200
Buffer Width = 200