Rectangle rect = new Rectangle();
rect = Screen.GetWorkingArea(this);
rect.Width;//屏幕宽
rect.Height;//屏幕高
Console.WriteLine("高度"+Screen.PrimaryScreen.WorkingArea.Height+"宽度"+Screen.PrimaryScreen.WorkingArea.Width);
System.Drawing.Rectangle rect =
System.Windows.Forms.Screen.PrimaryScreen.Bounds;
int h = rect.Height; //高(像素)
int w = rect.Width; //宽(像素)