The exception that is thrown when the operating system denies access because of an I/O error or a specific type of security error.
See Also: UnauthorizedAccessException Members
An UnauthorizedAccessException exception is typically thrown by a method that wraps a Windows API call. To find the reasons for the exception, examine the text of the exception object's Exception.Message property.
UnauthorizedAccessException uses the HRESULT COR_E_UNAUTHORIZEDACCESS, which has the value 0x80070005.