
- 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
How to get the Standard Input and Output Stream through Console in C#?
To get the standard input stream through Console, the code is as follows −
Example
using System; public class Demo { public static void Main(string[] args){ Console.WriteLine("Displaying standard input stream..."); Console.WriteLine("Standard Input Stream = "+Console.In); } }
Output
This will produce the following output −
Displaying standard input stream... Standard Input Stream = System.IO.TextReader+SyncTextReader
Example
Let us now see an example to display standard output stream −
using System; public class Demo { public static void Main(string[] args){ Console.WriteLine("Displaying standard output stream..."); Console.WriteLine("Standard Output Stream = "+Console.Out); } }
Output
This will produce the following output −
Displaying standard output stream... Standard Output Stream = System.IO.TextWriter+SyncTextWriter
- Related Articles
- Getting the Standard Output and Standard Error Output Stream through Console in C#
- Standard Input Stream (cin) in C++
- What is C++ Standard Output Stream (cout)?
- Check if Input, Output and Error is redirected on the Console or not in C#
- How to change the Output Encoding Scheme of the C# Console?
- How to play Beep sound through Console in C#?
- How to change the Input Encoding Scheme of the C# Console?
- Get number from user input and display in console with JavaScript
- Way to read input from console in C#
- Basic Input/Output in C++
- How to play user modified Beep sound through Console in C#?
- How to flush output stream after writing bytes
- What is C++ Standard Error Stream (cerr)?
- Explain unformatted input and output functions in C language
- What are the input and output for strings in C language?

Advertisements