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

AlanRank #669 · 3.6K reputationPosted Mar 6, 2008, 11:46 PM EST
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.
Dinusha Gamage67 reputationPosted Mar 7, 2008, 12:35 AM EST