C#中,双屏/两屏/三屏/多屏跳转判断

之前伤脑筋写过一次在Web中,JS,ActiveXObject去读取显示器数量、分辨率去判断单双屏跳转。

那么在客户端中,用C#去读取硬件信息,更方便更容易!

思路参考代码:

if (Screen.AllScreens.Length == )
{
//此显示器是否为主屏
if (Screen.AllScreens[].Primary)
{
this.Top = Screen.AllScreens[].Bounds.Y;
this.Left = Screen.AllScreens[].Bounds.X;
}
else
{
this.Top = Screen.AllScreens[].Bounds.Y;
this.Left = Screen.AllScreens[].Bounds.X;
}
}
else if (Screen.AllScreens.Length == )
{
this.Top = Screen.AllScreens[].Bounds.Y;
this.Left = Screen.AllScreens[].Bounds.X;
}
上一篇:op 和 oo 的区别


下一篇:[liu yanling]软件测试分为哪几个计划过程阶段