You can use Environment.Exit(0);
and Application.Exit
Environment.Exit(0)
is cleaner.
More Related Contents:
- Opening a text file is passed as a command line parameter [closed]
- Why does this nested loop output starts at 8 and 18?
- Capture console exit C#
- Listen for key press in .NET console app
- How do I show a console output/window in a forms application?
- Could not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException)
- how to run a winform from console application?
- Custom text color in C# console application?
- Global hotkey in console application
- Why does closing a console that was started with AllocConsole cause my whole application to exit? Can I change this behavior?
- How can I write fast colored output to Console?
- Displaying Arabic characters in C# console application
- How to programmatic disable C# Console Application’s Quick Edit mode?
- Command to close an application of console?
- Why the default SynchronizationContext is not captured in a Console App?
- How to keep console window open
- Console App Mouse-Click X Y Coordinate Detection/Comparison
- Startup.cs in a self-hosted .NET Core Console Application
- Is there a way to make a console application run using only a single file in .NET Core?
- C# console application icon
- How to run code before program exit? [duplicate]
- Password masking console application
- How to navigate a few folders up?
- ThreadPool not starting new Thread instantly
- Compile to a stand-alone executable (.exe) in Visual Studio
- Compile to stand alone exe for C# app in Visual Studio 2010
- How do I find out what directory my console app is running in?
- How do I get a return value from Task.WaitAll() in a console app?
- System.drawing namespace not found under console application
- How to use Application.Exit Event in WPF?