Console.OpenStandardInput Method is used to get the standard input stream. There are two overloads of OpenStandardInput method available in C# which are listed below:
- OpenStandardInput() Method
- OpenStandardInput(int32) Method
It is used to get the standard input stream. Make the object of Stream class and by using this method, the user can give the Input reference to that object. It creates a buffer which is used to take user input. This method can also be used to reacquire the standard input stream after it has been changed by the SetIn method.
public static System.IO.Stream OpenStandardInput ();
It is also used to get the standard input stream which is set to specified buffer size. The value passed in this method determines the size of the buffer. This method can also be used to reacquire the standard input stream after it has been changed by the SetIn method.
Syntax: public static System.IO.Stream OpenStandardInput (int bufferSize);
buffersize: It is the internal stream buffer size.
Return Value: It returns the standard input stream.
Exception: This method will give ArgumentOutOfRangeException if the buffersize is less than or equal to zero.
- Difference between Method Overriding and Method Hiding in C#
- HTML | DOM contains() Method
- C# | Math.Abs() Method | Set - 2
- C# | Replace() Method
- C# | Insert() Method
- C# | IsNullOrEmpty() Method
- C# | Math.Pow() Method
- Stack.Pop() Method in C#
- Main Method in C#
- C# | Math.Sin() Method
- C# | Math.Exp() Method
- C# | Math.Abs() Method | Set - 1
- jQuery | die() Method
- C# | Uri.GetHashCode() Method
- Stack.Contains() Method in C#
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.