<PackageReference Include="System.Security.Permissions" Version="9.0.6" />

FileIOPermission

Controls the ability to access files and folders. This class cannot be inherited.
public FileIOPermissionAccess AllFiles { get; set; }

Gets or sets the permitted access to all files.

Gets or sets the permitted access to all local files.

public FileIOPermission(FileIOPermissionAccess access, string path)

Initializes a new instance of the FileIOPermission class with the specified access to the designated file or directory.

public FileIOPermission(FileIOPermissionAccess access, string[] pathList)

Initializes a new instance of the FileIOPermission class with the specified access to the designated files and directories.

public FileIOPermission(FileIOPermissionAccess access, AccessControlActions actions, string path)

Initializes a new instance of the FileIOPermission class with the specified access to the designated file or directory and the specified access rights to file control information.

public FileIOPermission(FileIOPermissionAccess access, AccessControlActions actions, string[] pathList)

Initializes a new instance of the FileIOPermission class with the specified access to the designated files and directories and the specified access rights to file control information.

Initializes a new instance of the FileIOPermission class with fully restricted or unrestricted permission as specified.

public void AddPathList(FileIOPermissionAccess access, string path)

Adds access for the specified file or directory to the existing state of the permission.

public void AddPathList(FileIOPermissionAccess access, string[] pathList)

Adds access for the specified files and directories to the existing state of the permission.

public string[] GetPathList(FileIOPermissionAccess access)

Gets all files and directories with the specified FileIOPermissionAccess.

public bool IsUnrestricted()

Returns a value indicating whether the current permission is unrestricted.

public void SetPathList(FileIOPermissionAccess access, string path)

Sets the specified access to the specified file or directory, replacing the existing state of the permission.

public void SetPathList(FileIOPermissionAccess access, string[] pathList)

Sets the specified access to the specified files and directories, replacing the current state for the specified access with the new set of paths.