Private Sub FrmLogin_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'AddHandler AppDomain.CurrentDomain.UnhandledException, New UnhandledExceptionEventHandler(AddressOf CurrentDomain_UnhandledException)
AddHandler Application.ThreadException, New System.Threading.ThreadExceptionEventHandler(AddressOf Application_ThreadException)
End Sub
Shared Sub Application_ThreadException(ByVal sender As Object, ByVal e As System.Threading.ThreadExceptionEventArgs)
MessageBox.Show(e.Exception.ToString(), "系統錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Sub
Shared Sub CurrentDomain_UnhandledException(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
MessageBox.Show(e.ExceptionObject.ToString(), "系統錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Sub