I have a winforms app that checks user credentials as it starts. If autharization fails I want to close the app. So I have been using the following
Public Sub New()
_CurrentUser.GetuserDetails
If _CurrentUser.IsAuthorized then
'Let the app start
Else
'Shut it down
Me.Close()
End IF
End Sub
However this produces a "Cannot access a disposed object" error Any Ideas?