Sets the height and width of the console window to the specified values.
Assembly: mscorlib (in mscorlib.dll)
width or height is less than or equal to zero.
width or height is greater than the largest possible window width or height for the current screen resolution and console font.
The user does not have permission to perform this action.
An I/O error occurred.
The example reports the dimensions of a console window set to 85 columns and 43 rows, then waits for a key to be pressed. When any key is pressed, the dimensions of the console window are halved, the new dimensions are reported, and the example waits for another key press. Finally, when any key is pressed, the console window is restored to its original dimensions and the example terminates.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.