引用System.Management安装包。
using System.Management; ManagementObjectSearcher mydisplayResolution = new ManagementObjectSearcher("SELECT CurrentHorizontalResolution, CurrentVerticalResolution FROM Win32_VideoController"); foreach (ManagementObject record in mydisplayResolution.Get()) { Console.WriteLine("-----------------------Current Resolution---------------------------------"); Console.WriteLine("CurrentHorizontalResolution - " + record["CurrentHorizontalResolution"]); Console.WriteLine("CurrentVerticalResolution - " + record["CurrentVerticalResolution"]); }
标签:CurrentVerticalResolution,Management,Console,C#,分辨率,CurrentHorizontalResolution, From: https://www.cnblogs.com/blossomwei/p/17765496.html