See Also: FileIOPermissionAttribute Members
The level of access to a file or directory is specified using the members of the current instance. For example, to specify read permissions for a file, set the FileIOPermissionAttribute.Read property equal to the name of the file.
The security information declared by a security attribute is stored in the metadata of the attribute target, and is accessed by the system at run-time. Security attributes are used for declarative security only. For imperative security, use the corresponding permission class, System.Security.Permissions.FileIOPermission.
The allowable System.Security.Permissions.FileIOPermissionAttribute targets are determined by the System.Security.Permissions.SecurityAction passed to the constructor.
Case-sensitivity of file and directory names is platform dependent. The set of characters that are valid for use in file and directory names is determined by the current file system.
The following example shows a declarative request for full access to the specified file. The SecurityAction.RequestMinimum security action indicates that this is the minimum permission required for the target assembly to be able to execute.
The following example shows how to demand that the calling code has unrestricted access to files and directories. Demands are typically made to protect methods or classes from malicious code.