获取屏幕分辨率(C#)

C#获取屏幕分辨率的方法

 1 static void Main(string[] args)
 2 {
 3     // 控制台程序,需要添加程序集:
 4     // using System.Drawing;
 5     // using System.Windows.Forms;
 6     
 7     Console.Title = "Dan.Jacky QQ:773091523";
 8     Console.ForegroundColor = ConsoleColor.Green;
 9 
10     int SW = Screen.PrimaryScreen.Bounds.Width;
11     int SH = Screen.PrimaryScreen.Bounds.Height;
12     Console.WriteLine(string.Format("当前屏幕的分辨率为:{0}×{1}", SW, SH));
13 
14     Console.ReadKey(true);
15 }

 

 

posted @ 2013-12-23 16:35  Wendy.Jacky  阅读(1114)  评论(0编辑  收藏  举报