console related

"press any key to continue" for the console

Page 1 of 1

2 Replies - 419 Views - Last Post: 08 May 2010 - 11:17 AM Rate Topic: -----

#1 yarok  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 12
  • Joined: 11-January 10

console related

Posted 08 May 2010 - 11:14 AM

Hey there,
I would like to make my program to pause until I press a key in the console window, and the only way I found that works so far is to write the Console.ReadLine() method, like so:


Console.WriteLine("Press any key to continue...");
            Console.ReadLine();
            



If i'm not mistaken there should be some kind of
 system pause; 
command that does that, but I couldn't find it...
Any suggestions would be welcome!

Is This A Good Question/Topic? 0
  • +

Replies To: console related

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: console related

Posted 08 May 2010 - 11:16 AM

You're doing it the right way. In C# there isnt system commands like that, but it is available in C++ (though highly recommended that you not lose them, you lost portability when you do that because those system commands are available on Windows only).
Was This Post Helpful? 1
  • +
  • -

#3 yarok  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 12
  • Joined: 11-January 10

Re: console related

Posted 08 May 2010 - 11:17 AM

View PostPsychoCoder, on 08 May 2010 - 10:16 AM, said:

You're doing it the right way. In C# there isnt system commands like that, but it is available in C++ (though highly recommended that you not lose them, you lost portability when you do that because those system commands are available on Windows only).



Thanks for the quick answer!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1