public class UnauthorizedAccessException : SystemException
Object
Exception
SystemException
UnauthorizedAccessException
mscorlib
BCL
Represents the error that occurs when an I/O operation cannot be performed because of incompatible file access levels.
UnauthorizedAccessException is typically thrown when a request is made to write to a read-only file, or a file I/O operation is requested on a directory.
System Namespace
UnauthorizedAccessException Constructors
UnauthorizedAccessException() Constructor
UnauthorizedAccessException(System.String) Constructor
UnauthorizedAccessException(System.String, System.Exception) Constructor
public UnauthorizedAccessException();
Constructs and initializes a new instance of the UnauthorizedAccessException class.
This constructor initializes the System.UnauthorizedAccessException.Message property of the new instance to a system-supplied message that describes the error, such as "Attempted to perform an unauthorized operation." This message takes into account the current system culture.The System.UnauthorizedAccessException.InnerException property of the new instance is initialized to
null
.
System.UnauthorizedAccessException Class, System Namespace
public UnauthorizedAccessException(string message);
Constructs and initializes a new instance of the UnauthorizedAccessException 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.UnauthorizedAccessException.Message property of the new instance using message. If message isnull
, the System.UnauthorizedAccessException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.The System.UnauthorizedAccessException.InnerException property of the new instance is initialized to
null
.
System.UnauthorizedAccessException Class, System Namespace
public UnauthorizedAccessException(string message, Exception inner);
Constructs and initializes a new instance of the UnauthorizedAccessException 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.
- inner
- An instance of Exception that is the cause of the current exception. If inner is non-null, then the current Exception was raised in a catch block handling inner.
This constructor initializes the System.UnauthorizedAccessException.Message property of the new instance using message and the System.UnauthorizedAccessException.InnerException property using inner. If message isnull
, the System.UnauthorizedAccessException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.[Note: For more information on inner exceptions, see System.Exception.InnerException.]
System.UnauthorizedAccessException Class, System Namespace