Caution
Code Access Security is not supported or honored by the runtime.
Specifies the type of file access requested.
This enumeration supports a bitwise combination of its member values.
public enum class FileIOPermissionAccess
[System.Flags]
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum FileIOPermissionAccess
[System.Flags]
[System.Serializable]
public enum FileIOPermissionAccess
[System.Flags]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum FileIOPermissionAccess
[System.Flags]
public enum FileIOPermissionAccess
[<System.Flags>]
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type FileIOPermissionAccess =
[<System.Flags>]
[<System.Serializable>]
type FileIOPermissionAccess =
[<System.Flags>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type FileIOPermissionAccess =
[<System.Flags>]
type FileIOPermissionAccess =
Public Enum FileIOPermissionAccess
No access to a file or directory. NoAccess represents no valid FileIOPermissionAccess values and causes an ArgumentException when used as the parameter for GetPathList(FileIOPermissionAccess), which expects a single value.
Read 1Access to read from a file or directory.
Write 2Access to write to or delete a file or directory. Write access includes deleting and overwriting files or directories.
Append 4Access to append material to a file or directory. FileIOPermissionAccess.Append
access includes the ability to create a new file or directory. To create files, code must also be granted bothAppend
and either Write
or Read
access.
Access to the information in the path itself. This helps protect sensitive information in the path, such as user names, as well as information about the directory structure revealed in the path. This value does not grant access to files or folders represented by the path.
For performance reasons, PathDiscovery
should only be granted to directories, not to files. For example, PathDiscovery
permission should be granted to paths such as C:\test and C:\test\\, not C:\test\example.txt.
Append, Read, Write, and PathDiscovery access to a file or directory. AllAccess represents multiple FileIOPermissionAccess values and causes an ArgumentException when used as the access
parameter for the GetPathList(FileIOPermissionAccess) method, which expects a single value.
Caution
Code Access Security (CAS) has been deprecated across all versions of .NET Framework and .NET. Recent versions of .NET do not honor CAS annotations and produce errors if CAS-related APIs are used. Developers should seek alternative means of accomplishing security tasks.
This enumeration is used with the FileIOPermission class.
Note
Giving Write
access to an assembly is similar to granting it Full Trust. If an application should not write to the file system, it should not have Write access.
Although NoAccess
and AllAccess
are members of FileIOPermissionAccess
, they are not valid for use as the parameter for GetPathList because they describe no file access types or all file access types, respectively. FileIOPermission.GetPathList expects a single file access type.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4