I have a program in which I will check if a file exists. If this happens, the form will load. But if not, a message appears informing the user, and then the application should close without showing the form.
How do I do it right? I tried using this code in the constructor:
Environment.Exit(-1);
He does what I want, but from what I read, this is not a good way to do this. It's right? Or I'll just use the code above.
source
share