How to exit a VB.NET program

To exit a VB program then use the Application.Exit method for forms and System.Environment.Exit(exitCode) for a console application - make sure that you have closed all resources before calling.