
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
Getting the Standard Output and Standard Error Output Stream through Console in C#
To get the standard output stream through Console, the code is as follows −
Example
using System; public class Demo { public static void Main(string[] args){ Console.WriteLine("Standard Output Stream = "+Console.Out); } }
Output
This will produce the following output −
Standard Output Stream = System.IO.TextWriter+SyncTextWriter
Example
To get the standard error output stream through Console, the code is as follows −
using System; public class Demo { public static void Main(string[] args){ Console.WriteLine("Standard Output Stream = "+Console.Out); Console.WriteLine("Standard Error Output Stream = "+Console.Error); } }
Output
This will produce the following output −
Standard Output Stream = System.IO.TextWriter+SyncTextWriter Standard Error Output Stream = System.IO.TextWriter+SyncTextWriter
- Related Articles
- How to get the Standard Input and Output Stream through Console in C#?
- What is C++ Standard Output Stream (cout)?
- What is C++ Standard Error Stream (cerr)?
- Check if Input, Output and Error is redirected on the Console or not in C#
- Standard Input Stream (cin) in C++
- How to flush output stream after writing bytes
- Getting console.log output from Firefox with Selenium.
- How to find the standard error of mean in R?
- How to calculate standard error of the mean in Excel?
- How to change the Output Encoding Scheme of the C# Console?
- C++ Program to implement standard error of mean
- Redirect Output to location with Permission denied Error?
- What is British standard system and international standard system?
- How to Remove Unicode from Jenkins Console Output logs using Postman?
- Getting console.log output from Chrome with Selenium Python API bindings.

Advertisements