See Also: FileIOPermission Members
System.Object
System.Security.CodeAccessPermission
System.Security.Permissions.FileIOPermission
All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.
System.Security.Permissions.FileIOPermission objects describe protected operations on files and directories. Files and directories are specified using absolute paths. Case-sensitivity of files and directories is platform and file system dependent.
Note:This permission distinguishes between the following types of file I/O access provided by System.Security.Permissions.FileIOPermissionAccess:
- Read: Read access to the contents of the file or access to information about the file, such as its length or last modification time.
- Write: Write access to the contents of the file or access to change information about the file, such as its name. Also allows for deletion and overwriting.
- Append : Ability to write to the end of a file only.
- PathDiscovery: Ability to obtain path information about a file.
- NoAccess: No access to the file or directory.
- AllAccess: Full access to the file or directory.
These access levels are independent, meaning that rights to one do not imply rights to another. For example, Write permission does not imply permission to Read or Append. System.Security.Permissions.FileIOPermissionAccess values can be combined using a bitwise OR operator.
For information on security considerations when accessing files, see System.IO.FileStream .
The XML encoding of a FileIOPermission instance is defined below in EBNF format. The following conventions are used:
- All non-literals in the grammar below are shown in normal type.
- All literals are in bold font.
The following meta-language symbols are used:
- '*' represents a meta-language symbol suffixing an expression that can appear zero or more times.
- '?' represents a meta-language symbol suffixing an expression that can appear zero or one time.
- '+' represents a meta-language symbol suffixing an expression that can appear one or more times.
- '(',')' is used to group literals, non-literals or a mixture of literals and non-literals.
- '|' denotes an exclusive disjunction between two expressions.
- '::= ' denotes a production rule where a left hand non-literal is replaced by a right hand expression containing literals, non-literals or both.
BuildVersion refers to the build version of the shipping CLI. This is specified as a dotted build number such as '2412.0' .
ECMAPubKeyToken ::= b77a5c561934e089
FileName refers to the full path and file name of a file, or to a path name, such as "C:\Temp\test.exe" or "C:\ ".
The XML encoding of a FileIOPermission instance is as follows:
FileIOPermissionXML ::=
<IPermissionclass="
System.Security.Permissions.FileIOPermission,
mscorlib,
Version=1.0.BuildVersion,
Culture=neutral,
PublicKeyToken=ECMAPubKeyToken"
version="1"
(
Unrestricted="true"
)
|
(
(Read="FileName (; FileName )*" ) ?
(Write="FileName (; FileName )*" ) ?
(Append="FileName (; FileName )*" ) ?
(PathDiscovery="FileName (; FileName )*" ) ?
)
/>
Namespace: System.Security.Permissions
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0