Mono Class Library: System.Console Overview | Members

System.Console.Read Method

Reads the next character from the standard input stream.

public static int Read ()

Returns

The next character from the character source represented as a int , or -1 if at the end of the stream.

Exceptions

TypeReason
System.IO.IOExceptionAn I/O error occurred.

Remarks

This method will not return until the read operation is terminated; for example, by the user pressing the enter key. If data is available, the input stream contains what the user entered, suffixed with the environment dependent newline character.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0