Search notes:

System.Console (class)

The System.Console class allows to programatically access stdin, stdout and stderr in console applications.

Properties, methods and events

BackgroundColor, ForegroundColor A member of the System.ConsoleColor enum.
Beep()
BufferHeight, BufferWidth
CancelKeyPress The only event: fired when ctrl+C or ctrl+break is pressed. See also TreatControlCAsInput()
CapsLock
Clear()
CursorLeft, CursorTop
CursorSize
CursorVisible
GetCursorPosition()
In, Out, Error stdin, stdout and stderr. These streams are provided using (derivates of) System.IO.TextReader and System.IO.TextWriter objects.
InputEncoding, OutputEncoding This value can be assigned instances of types derived from System.Text.Encoding. See also using the PowerShell cmdlet select-string to match lines in STDOUT that match a given regular expressions.
IsErrorRedirected
IsInputRedirected
IsOutputRedirected
KeyAvailable
LargestWindowHeight
LargestWindowWidth
MoveBufferArea()
NumberLock
OpenStandardError()
OpenStandardInput()
OpenStandardOutput()
Read()
ReadKey() Read one character (as instance of System.ConsoleKeyInfo) from input. Compare with ReadLine()
ReadLine() Reads an entire line of input. Compare with ReadKey()
ResetColor()
SetBufferSize()
SetCursorPosition()
SetError()
SetIn()
SetOut()
SetWindowPosition()
SetWindowSize()
Title
TreatControlCAsInput If set to $true, Ctrl-C can be read with ReadKey(). See also CancelKeyPress
WindowHeight
WindowLeft
WindowTop
WindowWidth
Write()
WriteLine() Like Write(), but terminate with a new line character.

Encodings

Input and output encodings are controlled through the respective properties InputEncoding and OutputEncoding which need to be an instance of System.Text.Encoding.
Compare with the value of the PowerShell preference variable $OutputEncoding.

See also

The PowerShell cmdLet noun host
conhost.exe

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1788421513, '216.73.217.21', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/dot-net/namespaces-classes/System/Console/index(96): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78