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