System.Console.SetIn Method

Sets the Console.In property to the specified System.IO.TextReader object.

Syntax

public static void SetIn (System.IO.TextReader newIn)

Parameters

newIn
A stream that is the new standard input.

Exceptions

TypeReason
ArgumentNullException newIn is null.

Remarks

By default, the Console.In property is set to the standard input stream.

A System.IO.StreamReader that encapsulates a System.IO.FileStream can be used to receive input from a file.

Permissions

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0