Код выходит со странным сообщением - PullRequest
0 голосов
/ 06 февраля 2011

Вот мой код, у меня два монитора.

try
{
    Screen[] allScreens = Screen.AllScreens;
    Console.WriteLine("count=" + allScreens.Count());
    var b = allScreens[0];
    Console.WriteLine("first=" + b);
    var c = allScreens[1];
    Console.WriteLine("second=" + c);
}
catch (Exception e)
{
    Console.WriteLine("e=" + e);
    throw;
}

вывод

count=2
first=Screen[Bounds={X=-1280,Y=0,Width=1280,Height=1024} WorkingArea={X=-1280,Y=0,Width=1280,Height=996} Primary=False DeviceName=\\.\DISPLAY1The program '[1168] WindowsFormsApplication1.vshost.exe: Program Trace' has exited with code 0 (0x0).

Почему я не могу получить второй экран и почему просто нет ошибки / исключенияэтот странный текст в консоли?

...