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);
1.4m articles
1.4m replys
5 comments
57.0k users