title: How to handle unexpected shut down of vb.net application
body: <p>I'm developing VB.Net application and i wanted to block users from open another session of the program while they already has one</p>
  
  <p>so i made a value in my DB that changes from Offline to Online and reverse according to the status of the log in</p>
  
  <p><code>Program Started = Online (In Form Load Event)</code><br>
  <code>Program Closed = Offline (In Form Closing Event)</code></p>
  
  <p>The problem is : some times the program hang or windows ..... etc so the program don't change the DB value for that user from Online to Offline and this prevent him from opening the application</p>
  
  <p>so how i can handle the unexpected shut down of my program to deal with this case?</p>