在C#中,能够使用System.Windows.SystemParameters获取有关屏幕真实状态的基本信息。orm
1. 获取屏幕像素:io
使用
SystemParameters.FullPrimaryScreenHeightform
SystemParameters.FullPrimaryScreenWidthim
2. 获取工做区(不包括任务栏)像素:工作
使用
SystemParameters.WorkArea.Height
SystemParameters.WorkArea.Width像素
C# 得到屏幕大小 Rectangle rect=System.Windows.Forms.SystemInformation.VirtualScreen; int width=rect.Width; int height=rect.Height;