Login feature

Phylum

Centurion
Joined
Jun 20, 2003
Messages
105
Location
Canada
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
 
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.
 
Back
Top