Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

Console.SetError Method

Sets the Error property to the specified TextWriter.

[Visual Basic]
Public Shared Sub SetError( _
   ByVal newError As TextWriter _
)
[C#]
public static void SetError(
 TextWriter newError
);
[C++]
public: static void SetError(
 TextWriter* newError
);
[JScript]
public static function SetError(
   newError : TextWriter
);

Parameters

newError
A TextWriter stream that is the new standard error output.

Exceptions

Exception Type Condition
ArgumentNullException newError is a null reference (Nothing in Visual Basic).
SecurityException The caller does not have the required permission.

Remarks

By default, the Error property is set to the standard error output stream.

A StreamWriter that encapsulates a FileStream can be used to send error messages to a file.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

.NET Framework Security: 

See Also

Console Class | Console Members | System Namespace | TextWriter | Error

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.