Dear Friends,
I have a problem when compling console applications. How can you keep in view mood the console application when you run the application? When I clicked on debug the application comleted the complation and automatically close the console application...... How can you view the result in the dos command widow?
Please help me......
Tnx
Dinusha GamagePosted Mar 7, 2008, 5:35 AM
AlanPosted Mar 7, 2008, 4:46 AM
If you're using .NET 2.0 or later (VS 2005 or 2008), then add the following line as the last line in your Main() method:
Console.ReadKey();
The console will now pause until you press a key.
If you're still using .NET 1.0/1.1 (VS 2002 or 2003), use the following line instead:
Console.ReadLine();
The console will then pause until you press the Enter key.