1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 /*============================================================
9 ** Purpose: An exception for OS 'access denied' types of
10 ** errors, including IO and limited security types
14 ===========================================================*/
16 using System
.Runtime
.Serialization
;
20 // The UnauthorizedAccessException is thrown when access errors
21 // occur from IO or other OS methods.
23 [System
.Runtime
.CompilerServices
.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
24 public class UnauthorizedAccessException
: SystemException
26 public UnauthorizedAccessException()
27 : base(SR
.Arg_UnauthorizedAccessException
)
29 HResult
= HResults
.COR_E_UNAUTHORIZEDACCESS
;
32 public UnauthorizedAccessException(string? message
)
35 HResult
= HResults
.COR_E_UNAUTHORIZEDACCESS
;
38 public UnauthorizedAccessException(string? message
, Exception
? inner
)
39 : base(message
, inner
)
41 HResult
= HResults
.COR_E_UNAUTHORIZEDACCESS
;
44 protected UnauthorizedAccessException(SerializationInfo info
, StreamingContext context
) : base(info
, context
)