Is there an event for Application_load and Application_cLose?

I need this function, even if I kill the application via the IDE. Any ideas?

reason: is I have a third party server that remember logins(permission) and after so many stops letting people login.

thanks,

Dean