📄 monitorinfo.cs
字号:
namespace Imps.Client.Utils.Information.Hardware
{
using Imps.Client.Utils.Win32;
using System;
public class MonitorInfo
{
private static MonitorInfo _instance;
private bool _isSlowMachine;
private int _number;
private string _resoulation;
private string _screen;
private MonitorInfo()
{
try
{
this._number = NativeMethods.GetSystemMetrics(80);
}
catch
{
this._number = 0;
}
try
{
this._resoulation = string.Format("{0} * {1}", NativeMethods.GetSystemMetrics(0), NativeMethods.GetSystemMetrics(1));
}
catch
{
this._resoulation = string.Empty;
}
try
{
this._screen = string.Format("{0} * {1}", NativeMethods.GetSystemMetrics(0x10), NativeMethods.GetSystemMetrics(0x11));
}
catch
{
this._screen = string.Empty;
}
try
{
if (NativeMethods.GetSystemMetrics(0x49) == 0)
{
this._isSlowMachine = false;
}
else
{
this._isSlowMachine = true;
}
}
catch
{
this._isSlowMachine = false;
}
}
public static MonitorInfo Instance
{
get
{
if (_instance == null)
{
_instance = new MonitorInfo();
}
return _instance;
}
}
public bool IsSlowMachine
{
get
{
return this._isSlowMachine;
}
}
public int Number
{
get
{
return this._number;
}
}
public string Resoulation
{
get
{
return this._resoulation;
}
}
public string Screen
{
get
{
return this._screen;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -