Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to close the current run of a program and start it again
i used
System.Windows.Forms.Application.Restart();
i got two run of program !

What I have tried:

System.Windows.Forms.Application.Restart();
Posted

1 solution

Restart should quit the current instance of the app and start a new instance, but sometimes the shutdown doesn't work as expected because of something your app is doing. I have no ideas what that is, but the workaround is really simple.
Call:
C#
Application.Restart();     // Start a new instance
Application.Exit();        // Quit the current instance
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900