- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
Advertisements