我收到此错误。我无法抓住它来自哪里。使用try catch创建的所有方法,但我仍然不时收到此错误。我用过代码:
Private Sub add2ComboBox_called(ByVal text As String)
Try
If Me.InvokeRequired Then
Dim args() As String = {text}
Me.Invoke(New Action(Of String)(AddressOf add2ComboBox_called), args)
Return
End If
ComboBox_called.Items.Add(text)
Catch ex As Exception
log_it(ex.StackTrace)
End Try
End Sub
还有这一个:
Public Sub clear_do_not_open()
Dim FILENAME As String = path & "\DO_NOT.OPEN"
Dim index As Integer
Try
Using fs As New IO.FileStream(FILENAME, IO.FileMode.Truncate, IO.FileAccess.Write, IO.FileShare.ReadWrite), _
tl As New TextWriterTraceListener(fs)
index = Trace.Listeners.Add(tl)
Trace.Write("")
Trace.Listeners(index).Flush()
Trace.Flush()
End Using
Trace.Listeners.RemoveAt(index)
Catch ex As Exception
log_it(ex.StackTrace)
End Try
End Sub
如果出现,如何在默认情况下按此重试?等一下再按一次重试?如果不是这样,那我怎么知道这个消息弹出来了?如果抓住它出现的那一刻我就可以重新启动程序或发送电子邮件到myselt所以我可以来到PC运行程序,我可以处理它。现在消息弹出,程序在打开时停止。