PC Review


Reply
Thread Tools Rate Thread

CONSOLE: how to do "Press Any Key To Continue"

 
 
Paul Johnston
Guest
Posts: n/a
 
      25th Feb 2004
I'm using VB.Net. I've tried using Console.Read() but it requires a
line-terminator before it finishes (doesn't that mean it's functionally
equivalent to ReadLine() -- why have it then?). I've tried
Console.In.ReadBlock(), too, with no success.

So, along these lines, how would I implement, simply, a "Press Any Key to
Continue" routine or, more complex, a text menu in a Console app to get a
single character?

i.e.
1. Declare your hate for VB.Net
2. Declare your love for VB.Net
X. No Comment
Enter Your Choice [1,2,X]:

Thanks, folks.


 
Reply With Quote
 
 
 
 
John Vottero
Guest
Posts: n/a
 
      4th Mar 2004
"Paul Johnston" <pjoh_DELETETHIS_nston@lw_DELETETHIS_cb.ca> wrote in message
news:uk37V%238%(E-Mail Removed)...
> I'm using VB.Net. I've tried using Console.Read() but it requires a
> line-terminator before it finishes (doesn't that mean it's functionally
> equivalent to ReadLine() -- why have it then?). I've tried
> Console.In.ReadBlock(), too, with no success.
>
> So, along these lines, how would I implement, simply, a "Press Any Key to
> Continue" routine or, more complex, a text menu in a Console app to get a
> single character?
>
> i.e.
> 1. Declare your hate for VB.Net
> 2. Declare your love for VB.Net
> X. No Comment
> Enter Your Choice [1,2,X]:
>


Console.In.ReadBlock(...) might be what you're looking for.


 
Reply With Quote
 
Marc Scheuner [MVP ADSI]
Guest
Posts: n/a
 
      5th Mar 2004
On Wed, 25 Feb 2004 13:45:48 -0500, "Paul Johnston"
<pjoh_DELETETHIS_nston@lw_DELETETHIS_cb.ca> wrote:

>I'm using VB.Net. I've tried using Console.Read() but it requires a
>line-terminator before it finishes (doesn't that mean it's functionally
>equivalent to ReadLine() -- why have it then?). I've tried
>Console.In.ReadBlock(), too, with no success.
>
>So, along these lines, how would I implement, simply, a "Press Any Key to
>Continue" routine or, more complex, a text menu in a Console app to get a
>single character?
>
>i.e.
>1. Declare your hate for VB.Net
>2. Declare your love for VB.Net
>X. No Comment
>Enter Your Choice [1,2,X]:
>
>Thanks, folks.
>

You might need to wait until Whidbey is out - see these articles on
additional console-mode support in Whidbey (next version of Visual
Studio):

"Console Support In Whidbey
Whidbey is adding support for the full range of Console features
provided by Win32, such as manipulating the full console window,
applying colors, and reading directly from keyboard.
........
Keyboard input is accessed via the KeyAvailable, ReadKey,
TreatControlCAsInput members and the CancelKeyPress event. "
http://wesnerm.blogs.com/net_undocum...e_support.html

"Not Your Grandpa's Console
The BCL class that gains the most new features is the Console class.
Prior to the new features, the Console class allowed limited input and
output buffer access, and interactions limited to very linear
scenarios. Reading and writing task interactions with the screen
buffer were dictated by the simple Read, Write, ReadLine, and
WriteLine methods."

http://www.devx.com/codemag/Article/20150/0/page/5

Marc

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
while installing WIN XP (Booting from CD) I get the error: "adpu160m.sys file could not be found" Press any key to continue ... KJ-Kajun Windows XP Help 2 3rd Feb 2007 04:40 PM
while installing WIN XP (Booting from CD) I get the error: "adpu160m.sys file could not be found" Press any key to continue ... KJ-Kajun Windows XP Help 0 3rd Feb 2007 04:05 PM
while installing WIN XP (Booting from CD) I get the error: "adpu160m.sys file could not be found" Press any key to continue ... KJ-Kajun Windows XP Help 0 3rd Feb 2007 04:05 PM
Annoying dialog box "Press OK to continue loading the content of this page" Antonio Windows XP Internet Explorer 1 29th Mar 2004 10:50 PM
Persistent dialog box "Press OK to continue loading the content of this page" Antonio Caldas Windows XP Internet Explorer 1 12th Dec 2003 12:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:55 AM.