I have an VB.Net Console Application running and I do not want it to close when the user hit the ENTER button, rather I want it to close when they type EXIT and then press ENTER. What should I do?
I have an VB.Net Console Application running and I do not want it to
Share
Read from the console using Console.ReadLine() (which requires a carriage return to complete).
Another way to phrase it:
Remember that once you return from your
Mainmethod, your console application closes. It’s hard to advise you exactly what to do without seeing the logical structure of your application, but remember: if you want to prevent your application from exiting, don’t let yourMainmethod return.