Re: Run code EVERY time something closes
- From: "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@xxxxxxxxxxxxx>
- Date: Thu, 13 Oct 2005 14:38:18 -0500
Scott,
Is this a Windows Forms app?
If so:
Have you looked at using the Application.ApplicationExit event?
In addition to the Application.ThreadException &
AppDomain.UnhandledException events?
The ApplicationExit event should let you know when your app is exiting
normally, while the ThreadException will prevent exceptions during "window
event processing" from killing your app, and UnhandledException will let you
know when your app is not exiting normally.
--
Hope this helps
Jay [MVP - Outlook]
T.S. Bradley - http://www.tsbradley.net
"Scott M" <scott_M@xxxxxxxxxxxxx> wrote in message
news:u0jJMfC0FHA.2924@xxxxxxxxxxxxxxxxxxxxxxx
|I have a procedure in my Dispose method that records my application was
| closed in a database. However, when I kill a process or an unhandled
| exception occurs this does not seem to run. Is there some code that is
| GUARANTEED to run EVERY time the code exits? I don't mind if it runs
during
| garbage collection or whatever. I just need it to run to log the
| application closing for compliance reasons.
|
| Thanks in advance
| Scott
|
.
- Follow-Ups:
- Re: Run code EVERY time something closes
- From: Scott M
- Re: Run code EVERY time something closes
- References:
- Run code EVERY time something closes
- From: Scott M
- Run code EVERY time something closes
- Prev by Date: Run code EVERY time something closes
- Next by Date: Re: Databinding Checkboxes
- Previous by thread: Run code EVERY time something closes
- Next by thread: Re: Run code EVERY time something closes
- Index(es):
Relevant Pages
|