【发布时间】:2014-02-05 09:46:03
【问题描述】:
我无法处理这些导致我的程序冻结的错误。
如何处理所有这些? 这是我的调试器输出:
A first chance exception of type 'System.IO.IOException' occurred in System.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.dll
A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.TimeoutException' occurred in System.dll
A first chance exception of type 'System.IO.IOException' occurred in System.dll
我用过
Try
Dim str As String = SerialPort.ReadLine()
Catch ex As Exception
MsgBox(ex)
End Try
但程序仍然冻结!
【问题讨论】:
-
那些是第一次机会例外,应该被忽略。它们不会导致您的程序冻结。
-
如果没有什么可看的……
-
接收第一次机会异常通知 (msdn.microsoft.com/en-us/library/dd997368%28v=vs.110%29.aspx) 但正如 John 所说,它们不会导致您的程序冻结,似乎您的 SerialPort 未正确初始化。
标签: vb.net exception-handling first-chance-exception