Pause the Console.

Cheetah

Well-known member
Joined
Oct 12, 2006
Messages
232
Programming Experience
Beginner
Hi there,

I am trying to pause the console, so that it doesn't dissappear.

I don't want to use Console.Readline as when I do that, the user has to press enter or a button before I can write more lines to the console, or is there a way to get around this?

Thanks.
 
Pause for a specified length of time.

Do you mean you want the program to pause for a specific length of time, and then continue?
YOu can do this with the System.Threading.Thread.Sleep() method. The argument is an integer of 1000 for each second. For example, to pause for 2 1/2 seconds, you would use:
System.Threading.Thread.Sleep(2500)
 
You can also do this:
VB.NET:
Expand Collapse Copy
console.Writeline("Please Press any key to continue!")
console.readkey()
 
Back
Top