Link to home
Start Free TrialLog in
Avatar of ProWebNetworks
ProWebNetworks

asked on

Application Exit? End? Quit? How to?? C#

Application: C# Multiform Windows Application

I have an app that I will have a button for "Logout" that will run a series of code, and then is supposed to end the program. What code can I use that quickly terminates the application?

In Visual Basic I used:

End


Thanks.
Avatar of jeremymjackson
jeremymjackson
Flag of United States of America image

application.close()
Avatar of ProWebNetworks
ProWebNetworks

ASKER

Application.Close() gives error:
System.Windows.Forms.Application does not contain a definition for 'close'



I was thinking maybe:
System.Environment.Exit(0);




---I am going to test this now.
ASKER CERTIFIED SOLUTION
Avatar of ProWebNetworks
ProWebNetworks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Application.Exit(); is the correct syntax.