using System.Windows.Forms;
首先引用上面的命名空间。
然后在代码中获取屏幕信息。如下代码:
System.Windows.Forms.Screen screen = System.Windows.Forms.Screen.PrimaryScreen; System.Drawing.Rectangle rct = screen.Bounds;
int width= screen.WorkingArea.Width;
2023-01-26 20:44:54
using System.Windows.Forms;
首先引用上面的命名空间。
然后在代码中获取屏幕信息。如下代码:
System.Windows.Forms.Screen screen = System.Windows.Forms.Screen.PrimaryScreen; System.Drawing.Rectangle rct = screen.Bounds;
int width= screen.WorkingArea.Width;