Reads text from the console input field. The 'Button' argument specifies which button set is displayed. Returns an answer indicating which button was pressed to end input. The input text is available in the Console.LastReadResult property.
Console.ReadLine(Prompt, Buttons, [WebTimeout])
The method syntax has these parts:
Part | Description |
---|---|
Prompt (String) | Prompt message displayed above the input field, blinking. |
Buttons (Buttons) | Selects the button configuration to use during input. See the Buttons constants. |
WebTimeout (Long) | Timeout for the web virtual console (seconds, default 300) See note below |
Return (Answers) |
This method will raise an error after 300 seconds if the request comes from the web and the user does not respond within this interval. The timeout can be modified by including the optional WebTimeout parameter in the call.
The (symbolic) values for Answers are:
Constant | Value | Description |
---|---|---|
consCancel | 13 | The console Cancel button was pressed. |
consNo | 11 | The console No button was pressed. |
consOK | 12 | The console OK button was pressed. |
consYes | 10 | The console Yes button was pressed. |
The (symbolic) values for Buttons are:
Constant | Value | Description |
---|---|---|
consOkCancel | 1 | Show the OK and Cancel buttons. |
consOkOnly | 3 | Show only the OK button. |
consYesNo | 2 | Show the Yes and No buttons |