I have a winforms application that uses a network socket and I want to close the socket when the application is closed so how can I fire an event when the application is closed?
I found the Application Event. You can trigger an event on application close like this
System.Windows.Forms.Application.ApplicationExit +=new System.EventHandler(this.shutdownHandler);
2.1m questions
2.1m answers
60 comments
57.0k users