Windows 7中的显示设置(控制面板 - >显示).它允许更改屏幕上的文本和其他项目的大小.我需要让这个设置能够根据设置值打开/关闭我的C#应用程序中的某些功能.那可能吗?
我想在不使用真正鼠标的情况下在Windows应用程序中执行单击(因此我可以将其最小化).就像机器人的行为一样.
我该怎么做?
如何在控制台应用程序中获取屏幕分辨率(如果可能)?
在Forms我可以使用:
int height = Screen.PrimaryScreen.Bounds.Height;
int width = Screen.PrimaryScreen.Bounds.Width;
Run Code Online (Sandbox Code Playgroud)
但我正在寻找专门的控制台方式。
所以解决我的问题的方法是由Marc-Antoine Jutras提出的。我需要int价值观,所以我是这样的:
int height = Convert.ToInt32(SystemParameters.PrimaryScreenHeight);
int width = Convert.ToInt32(SystemParameters.PrimaryScreenWidth);
Run Code Online (Sandbox Code Playgroud)