Redirects Console.In to the specified TextReader. By default, Console.In is set to the system's standard input stream.
[Visual Basic] Public Shared Sub SetIn( _ ByVal newIn As TextReader _ ) [C#] public static void SetIn( TextReader newIn ); [C++] public: static void SetIn( TextReader* newIn ); [JScript] public static function SetIn( newIn : TextReader );
Exception Type | Condition |
---|---|
ArgumentException | newIn is null. |
SecurityException | The caller does not have SystemStreamsPermission to set the standard error stream. |
A StreamReader that encapsulates a FileStream can be used to receive input from a file. The caller must have SystemStreamsPermission to set the standard input stream.