public class SystemException : Exception
Object
Exception
SystemException
mscorlib
BCL
SystemException is the base class for all exceptions defined by the system.
This class is provided as a means to differentiate between exceptions defined by the system versus exceptions defined by applications. [Note: For more information on exceptions defined by applications, see ApplicationException.]
[Note: SystemException does not provide information as to the cause of the Exception. In most scenarios, instances of this class should not be thrown. In cases where this class is instantiated, a human-readable message describing the error should be passed to the constructor.]
System Namespace
SystemException Constructors
SystemException() Constructor
SystemException(System.String) Constructor
SystemException(System.String, System.Exception) Constructor
public SystemException();
Constructs and initializes a new instance of the SystemException class.
This constructor initializes the System.SystemException.Message property of the new instance to a system-supplied message that describes the error, such as "A system error has occurred." This message takes into account the current system culture.The System.SystemException.InnerException property is initialized to
null
.
System.SystemException Class, System Namespace
public SystemException(string message);
Constructs and initializes a new instance of the SystemException class.
- message
- A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
This constructor initializes the System.SystemException.Message property of the new instance using message. If message isnull
, the System.SystemException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments. The System.SystemException.InnerException property is initialized tonull
.
System.SystemException Class, System Namespace
public SystemException(string message, Exception innerException);
Constructs and initializes a new instance of the SystemException class.
- message
- A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
- innerException
- An instance of Exception that is the cause of the current Exception. If innerException is non-null, then the current Exception was raised in a catch block handling innerException .
This constructor initializes the System.SystemException.Message property of the new instance using message, and the System.SystemException.InnerException property using innerException. If message isnull
, the System.SystemException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.[Note: For information on inner exceptions, see System.Exception.InnerException .]
System.SystemException Class, System Namespace