0

i am doing a vb.net application, wherein users need to log in to the system. if the system crashes or stop how will i change their log in status to log out?. what will i do to auto log out the user in the system?Thanks in advance.Your answer is big help for me.

1 Answers1

0

You can't do this unless you catch the error and do something or reroute code direction of execution upon encountering the error. You can do it like this...

Try
'Whatever regular code
Catch ex as Exception
'Upon encountering error do the logout code here
Finally
'This part executes whether your app encounters error or not, so if you just want to logout when your app meets the error, you can leave this blank.
End Try

This won't work if the error is a connection to the database.

chris_techno25
  • 2,401
  • 5
  • 20
  • 32
  • thank you for the response, i'll apply your suggestion, but where will i put the codes, in the main form?thanks – user3363439 Feb 28 '14 at 06:50
  • You'll need to put the code inside whatever SUB, events, functions you have most especially where it's most prone to unexpected errors, like inserting data into database and such, or volatile values as how they call it in C language. If it does answer your question, please mark my post as answered :) Thanks. – chris_techno25 Feb 28 '14 at 06:54