FileNotFoundException
is thrown. If
filename
is null, then
an
ArgumentNullException
is thrown. If
filename
is an empty string,
ArgumentException
is
thrown.
IOException
and
DirectoryNotFoundException
are also possible.
Redirecting the Standard Streams
As mentioned earlier, the standard streams, such as
Console.In
, can be redirected. By far, the
most common redirection is to a file. When a standard stream is redirected, input and/or
output is automatically directed to the new stream, bypassing the default devices. By
redirecting the standard streams, your program can read commands from a disk file, create
log files, or even read input from a network connection.
Redirection of the standard streams can be accomplished in two ways. First, when you
execute a program on the command line, you can use the
Do'stlaringiz bilan baham: |