| | |
Code for Exiting a C# Application
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hi,
i'm new 2 C#, so my question may seem stupid... but, what is the code to exit an application.
I know in java it is:
Thanx in advanced,
C++
i'm new 2 C#, so my question may seem stupid... but, what is the code to exit an application.
I know in java it is:
C# Syntax (Toggle Plain Text)
System.exit(0);
Thanx in advanced,
C++
Last edited by C++; Mar 19th, 2005 at 3:51 am. Reason: Forgot semicolon
r0ckbear for the forms if you put Form.Close(); you will only close the form without actually exiting the application, what i put is
Application.Exit();
Application.Exit();
:eek: Come and visit SharpCreativity.com :eek:
•
•
Join Date: Dec 2003
Posts: 55
Reputation:
Solved Threads: 6
•
•
•
•
Originally Posted by crypter
r0ckbear for the forms if you put Form.Close(); you will only close the form without actually exiting the application, what i put is
Application.Exit();
If you're application consists of of a main form (i.e. one created by using Application.Run(new Form()); ) then closing that form exits the application. Although, if you're doing it programaticly, then I wouldn't use that.
![]() |
Similar Threads
Other Threads in the C# Forum
- Previous Thread: Play a wave file (C#)
- Next Thread: Wait or pause method in C#
Views: 44667 | Replies: 10
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client code color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development drawing encryption enum event excel file files form format ftp function gcd gdi+ http httpwebrequest image index input java list listbox listener login mandelbrot math mouseclick mysql networking object oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






