This question already has an answer here:
Active9 years, 6 months ago
Apr 27, 2012 I was wondering how to log a process/application start/exit in event viewer? I know services are logged but applications are not. I need to run a program (or a batch file) after another program/process has been closed. I have so far concluded that you should log the process in event viewer. Since you are using Windows 7 you could consider using a. The application is a server which simply runs until the system shuts down or it receives a Ctrl+C or the console window is closed. Due to the extraordinary nature of the application, it is not feasible to 'gracefully' exit. System.Windows.Forms.Application.ExitThread( ) When we are running a winform application & need to exit or close SUB APPLICATION or CURRENT THREAD then we should use 'System.Windows.Forms.Application.ExitThread( )'. Before you exit your application, you really need to have all your other thread exited, unless they are background threads or the.
I have a little console C# program like
Now I want to do something after main() exit. I tried to write a deconstructor for Class Program, but it never get hit.
C# Application Exit Event
Does anybody know how to do it.
Thanks a lot
Frank
FrankFrank
2,86988 gold badges3838 silver badges5050 bronze badges
marked as duplicate by nawfal, JMK, Paul Beusterien, LarsTech, woolstarJan 10 '14 at 23:59
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Wpf Application Exit Event Not Called1 AnswerC# Console Application Exit EventGonzalo
18.1k33 gold badges5959 silver badges7070 bronze badges
Application Exit Event C# WpfNot the answer you're looking for? Browse other questions tagged c#exit or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |