Usually, I will just use Environment.Exit(code)
to exit an application. (Usually through a button click.) But I would like to know is it the proper way to exit, ie, releasing memory etc etc...
Just Close() all active/existing forms and the application should exit. ok.
The Exit method stops all running message loops on all threads and closes all windows of the application.
Furthermore, you could use Process. Kill Method to stop the associated process. The code snippet is as follow.
Just Close()
all active/existing forms and the application should exit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With