This method is used to acquire a standard error stream. This method can be used to reacquire the standard error stream after it has been changed by the SetError method.
public static System.IO.Stream OpenStandardError ();
Returns: This method returns the standard error stream.
Example: The below code first checks for the string to be GeeksForGeeks and if not so then the program calls the SetError method to redirect error information to a file, calls the OpenStandardError method in the process of reacquiring the standard error stream, and indicates that error information was written to a file. The StreamWriter.AutoFlush property is set to true before reacquiring the error stream. This ensures that output will be sent to the console immediately rather than buffered.
Executing on Cmd:
- Difference between Method Overriding and Method Hiding in C#
- C# | CompareOrdinal() Method
- C# | Uri.IsBaseOf(Uri) Method
- C# | Random.Next() Method
- Stack.Pop() Method in C#
- C# | Math.Log() Method
- C# | IndexOfAny() Method
- C# | Uri.GetHashCode() Method
- Extension Method in C#
- C# | Uri.FromHex() Method
- C# | Uri.IsHexDigit() Method
- C# | Dictionary.Add() Method
- C# | Clone() Method
- C# | Uri.IsHexEncoding() Method
- Method Hiding 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 firstname.lastname@example.org. 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.