Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I'm struggling with something that I thought would have been relatively simple. I'd like the user to enter a character into the console and have the console read it w/o the user having to press <enter>. ie: as soon as the user types a character, have the console read it.

 

I thought the following would help but it hasn't:

 

               //read the input...
               do {
                       ch = (char) Console.Read(); //get the char
               } while(ch == '\n' || ch == '\r');

Edited by basdewaard
Posted

Thanks for the link, divil, however I am not finding it easy to get going.

 

After reading readme files I opened the .sln (assuming running the project would link with the existing Console). The ConsoleExTest works (which was initially set as the Startup Project). I then tried to get ConsoleEx going but get an error along the lines of "A project with an Output Type of Class Library cannot be started directly". The message contained more information/suggestions which I tried w/o any luck.

 

I also tried to add (relevant) classes to my project but struggled.

 

Could you perhaps give me a rough idea of how I should go about tackling this?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...