看起来这应该很简单,但我无法找到它。在我的一些try / catch块中,我想实际停止服务继续执行。我通常使用application.exit,但在服务中不起作用。
Public Sub LogMessages(ByRef _msg As String, ByRef _method As String, Optional _errNum As Int16 = 0, Optional _errType As String = "I", Optional _
_abort As Boolean = False, Optional _checkErrorTable As Boolean = False)
.....logging code here
If _abort Then
LogMessages("Aborting", Reflection.MethodBase.GetCurrentMethod.Name, 900, "E")
'what to do to stop program here
End If
End Sub