Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am using VB .NET to create a program that allows the user to log in with a username and password. When they log in a entry is made in a database, and when they log out that entry is deleted. This works all fine and well except for 1 thing. If the user crashes while inside the program then the data entry obviously is not deleted and therefore the program still thinks they are logged in. Is there any way to detect the crash, or find out somehow that the user has crashed and therefore is no longer logged in?

 

Thanks in advance

Phylum

  • *Experts*
Posted

You could do a number of things to solve this problem. The most

direct, although most difficult, is to write flawless code so that the

program is guaranteed not to crash, but this is impossible.

 

A more reasonable option is to have a program running in the background

that periodically "pings" your program via the SendMessage API

or Sockets. If it doesn't receive a reply, then the program died,

and have this background program delete the record.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...