C# Console.WindowWidth 属性
WindowWidth 属性获取或设置控制台窗口的宽度。
声明一个变量。
int width;
现在,获取当前窗口的宽度。
width = Console.WindowWidth;
以下是完成的示例。
示例
using System;
using System.Numerics;
using System.Globalization;
class Demo {
static void Main() {
int width;
int height;
width = Console.WindowWidth;
height = Console.WindowHeight;
Console.WriteLine("Current window width = "+width);
Console.WriteLine("Current window height = "+height);
}
}输出
Current window width = 0 Current window height = 0
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP