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 }

 

 

相关文章:

  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2021-09-09
  • 2021-07-24
  • 2022-01-08
  • 2021-07-17
  • 2022-01-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-09-16
相关资源
相似解决方案