|
|
System.Console Class |
|
|
Description | |
|
The Console class provides basic support for applications that read characters from, and write characters to, the console. No error is thrown if the console does not exist (in a Windows application for example).
There are 3 streams associated with the Console :
1. Standard Input
The text that the user types in response to text read requests on the console are captured by this stream.
2. Standard Output
Normal text is written to this stream and normally displayed on the console.
3. Error stream
Error text is written to this stream and normally displayed on the console.
However, you can route the streams away from the console to files, for example. This is the normal practice for service applications written as console applications.
The Console class is not inheritable.
|
|
Methods | |
|
| OpenStandardError | Gets the Error Output Stream writer |
| OpenStandardInput | Gets the Standard Input Stream writer |
| OpenStandardOutput | Gets the Standard Output Stream writer |
| Read | Read a character from the Standard Input Stream |
| ReadLine | Reads a line of characters from the Standard Input Stream |
| SetError | Assigns a new Error Output Stream writer |
| SetIn | Assigns a new Standard Input Stream reader |
| SetOut | Assigns a new Standard Output Stream writer |
| Write | Writes data to the Standard Output Stream |
| WriteLine | Writes line terminated data to the Standard Output Stream |
|
|
|
Properties | |
|
In | | TextReader | | Standard input stream |
Out | | TextWriter | | Standard output stream |
Error | | TextWriter | | Standard output stream |
|
Microsoft MSDN links | |
|
|
|
|
|
|