Reputation: 69
I wrote a program that I need to use without the Visual Studio
. I found the .exe
file from the debug folder in the bin folder, I tried to use it but it closed just after I tried.
What do I need to do in order to keep it open after it finishes?
Thank you :)
Upvotes: 0
Views: 383
Reputation: 2026
You can write this after your code:
or
or even
It will close when you press any key.
Upvotes: 3
Reputation: 1033
Add a readkey at the end of a console application to have the window stay open untill you press any key
Console.ReadKey();
Upvotes: 0
Reputation: 3231
Put a ReadLine at the end of the program
public class Program
{
public void Main(string[] args)
{
/*Program logic*/
Console.WriteLine("Press enter to continue...");
Console.ReadLine();
}
}
Upvotes: 0