Console Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Represents the standard input, output, and error streams for console applications. This class cannot be inherited.

Inheritance Hierarchy

System.Object
  System.Console

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public NotInheritable Class Console
public static class Console

The Console type exposes the following members.

Properties

  Name Description
Public propertyStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Error Infrastructure. Gets the standard error output stream.
Public propertyStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 In Infrastructure. Gets the standard input stream.
Public propertyStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Out Infrastructure. Gets the standard output stream.

Top

Methods

  Name Description
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 ReadLine Infrastructure. Reads a line of characters from the console.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 SetError Infrastructure. Security Critical. Sets the Error property.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 SetIn Infrastructure. Security Critical. Sets the In property.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 SetOut Infrastructure. Security Critical. Sets the Out property.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Write(Char) Infrastructure. Writes the specified Unicode character value to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Write(array<Char[]) Infrastructure. Writes the specified array of Unicode characters to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Write(Int32) Infrastructure. Writes the text representation of the specified 32-bit signed integer value to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Write(Object) Infrastructure. Writes the text representation of the specified object to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Write(String) Infrastructure. Writes the specified string value to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Write(String, Object) Infrastructure. Writes the text representation of the specified object to the standard output stream using the specified format information.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Write(String, array<Object[]) Infrastructure. Writes the text representation of the specified array of objects to the standard output stream using the specified format information.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Write(array<Char[], Int32, Int32) Infrastructure. Writes the specified subarray of Unicode characters to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Write(String, Object, Object) Infrastructure. Writes the text representation of the specified objects to the standard output stream using the specified format information.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 Write(String, Object, Object, Object) Infrastructure. Writes the text representation of the specified objects to the standard output stream using the specified format information.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 WriteLine() Infrastructure. Writes the current line terminator to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 WriteLine(Char) Infrastructure. Writes the specified Unicode character, followed by the current line terminator, value to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 WriteLine(array<Char[]) Infrastructure. Writes the specified array of Unicode characters, followed by the current line terminator, to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 WriteLine(Int32) Infrastructure. Writes the text representation of the specified 32-bit signed integer value, followed by the current line terminator, to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 WriteLine(Object) Infrastructure. Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 WriteLine(String) Infrastructure. Writes the specified string value, followed by the current line terminator, to the standard output stream.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 WriteLine(String, Object) Infrastructure. Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream using the specified format information.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 WriteLine(String, array<Object[]) Infrastructure. Writes the text representation of the specified array of objects, followed by the current line terminator, to the standard output stream using the specified format information.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 WriteLine(String, Object, Object) Infrastructure. Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 WriteLine(String, Object, Object, Object) Infrastructure. Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information.

Top

Remarks

The console is unavailable in a Silverlight application.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference