BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Security.CodeAccessPermission System.Security.Permissions.IBuiltInPermission System.Security.Permissions.IUnrestrictedPermission System.Runtime.InteropServices.ComVisible(true)

This permission distinguishes between the following four types of file IO access provided by :

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. No ability to read.

PathDiscovery: 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 that is revealed in the path. This value does not grant access to files or folders represented by the path.

Giving 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 access.

All these permissions 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. If more than one permission is desired, they can be combined using a bitwise OR as shown in the code example that follows. File permission is defined in terms of canonical absolute paths; calls should always be made with canonical file paths.

describes protected operations on files and folders. The class helps provide secure access to files and folders. The security access check is performed when the handle to the file is created. By doing the check at creation time, the performance impact of the security check is minimized. Opening a file happens once, while reading and writing can happen multiple times. Once the file is opened, no further checks are done. If the object is passed to an untrusted caller, it can be misused. For example, file handles should not be stored in public global statics where code with less permission can access them.

specifies actions that can be performed on the file or folder. In addition, these actions can be combined using a bitwise OR to form complex instances.

Access to a folder implies access to all the files it contains, as well as access to all the files and folders in its subfolders. For example, Read access to C:\folder1\ implies Read access to C:\folder1\file1.txt, C:\folder1\folder2\, C:\folder1\folder2\file2.txt, and so on.

In versions of the .NET Framework before the net_v40_long, you could use the method to prevent inadvertent access to system resources by trusted code. is now obsolete, and access to resources is now determined solely by the granted permission set for an assembly. To limit access to files, you must run partially trusted code in a sandbox and assign it permissions only to resources that the code is allowed to access. For information about running an application in a sandbox, see How To: Run Partially Trusted Code in a Sandbox.

Controls the ability to access files and folders. This class cannot be inherited.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  is not a valid value.

  Creates either fully restricted (None) or Unrestricted access to files and directories.

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

  One of the enumeration values.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  specifies values not defined in .

  contains one or more characters that are invalid for use in files or directory names.

  did not specify the absolute path to the file or directory.

  This constructor allows only one of the values to be specified for the specified file or directory. Use the method to define complex permissions.

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

  A bitwise combination of the enumeration values.
  The absolute path of the file or directory.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  This constructor allows only one value to be specified for the specified files and directories. Use the method to define complex permissions.

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

  A bitwise combination of the enumeration values.
  An array containing the absolute paths of the files and directories.
- Constructor
  2.0.0.0
  4.0.0.0

  This constructor allows only one value to be specified for the specified file or directories. Use the method to define complex permissions.

  The parameter specifies whether the access control list (ACL) for the file or directory specified by can be changed, viewed, or cannot be accessed.

  An access control list (ACL) describes individuals or groups who have, or do not have, rights to specific actions on the given file and its properties. The ability to change or view an ACL is an important permission and should be granted with caution.

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

  A bitwise combination of the enumeration values.
  A bitwise combination of the enumeration values.
  The absolute path of the file or directory.
- Constructor
  2.0.0.0
  4.0.0.0

  This constructor allows only one value to be specified for the specified files and directories. Use the method to define complex permissions.

  The parameter specifies whether the access control list (ACL) for the file or directory specified by can be changed, viewed, or cannot be accessed.

  An access control list (ACL) describes individuals or groups who have, or do not have, rights to specific actions on the given file and its properties. The ability to change or view an ACL is an important permission and should be granted with caution.

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

  A bitwise combination of the enumeration values.
  A bitwise combination of the enumeration values.
  An array containing the absolute paths of the files and directories.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  Use this method to modify file and directory access by adding to the state of the current permission.

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

  A bitwise combination of the values. The absolute path of a file or directory.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  Use this method to modify file and directory access by adding to the state of the current permission.

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

  A bitwise combination of the values. An array containing the absolute paths of the files and directories.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.Permissions.FileIOPermissionAccess To be added.

  This property gets or sets the permitted access to all files on the local computer and network drives.

  An individual value can be checked for using a bitwise AND operation.

  Gets or sets the permitted access to all files.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.Permissions.FileIOPermissionAccess To be added.

  Local files are files contained on the local computer. Any files not accessed through a network drive are local files.

  An individual value can be checked for using a bitwise AND operation.

  Gets or sets the permitted access to all local files.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission

  A copy of the permission represents the same access to resources as the original permission.

  Creates and returns an identical copy of the current permission.

  A copy of the current permission.

  0
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Boolean ``

  For more information, see .

  Determines whether the specified object is equal to the current .

  true if the specified is equal to the current object; otherwise, false.

  The object to compare with the current .
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  The state of the current instance is changed to the state encoded in .

  For the XML encoding for this class, see the class page.

  This method overrides .

  is .

  does not contain the encoding for a instance.

  The version number of is not valid.

  Reconstructs a permission with a specified state from an XML encoding.

  The XML encoding used to reconstruct the permission. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32

  The hash code for two instances of the same permission might be different, hence a hash code should not be used to compare two objects.

  Gets a hash code for the object that is suitable for use in hashing algorithms and data structures such as a hash table.

  A hash code for the current object.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String[] ``

  Use this method to get the state of the current permission. To get the state of both Read and Write access, two calls to this method are required.

  The parameter is limited to the values of , which represent single types of file access. Those values are , , , and . The values acceptable to do not include and , which do not represent single types of file access.

  Gets all files and directories with the specified .

  An array containing the paths of the files and directories to which access specified by the parameter is granted.

  One of the values that represents a single type of file access.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission `` is not and is not of type .

  The intersection of two permissions is a permission that describes the set of operations they both describe in common. Only a demand that passes both original permissions will pass the intersection.

  Creates and returns a permission that is the intersection of the current permission and the specified permission.

  A new permission that represents the intersection of the current permission and the specified permission. This new permission is null if the intersection is empty.

  A permission to intersect with the current permission. It must be the same type as the current permission. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` is not and is not of type .

  The current permission is a subset of the specified permission if the current permission specifies a set of operations that is contained by the specified permission. For example, a permission that represents read access to C:\example.txt is a subset of a permission that represents read access to C:\. If this method returns true, the current permission represents no more access to the protected resource than does the specified permission.

  Determines whether the current permission is a subset of the specified permission.

  true if the current permission is a subset of the specified permission; otherwise, false.

  A permission that is to be tested for the subset relationship. This permission must be the same type as the current permission. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean

  An unrestricted permission represents access to all resources protected by the permission.

  Returns a value indicating whether the current permission is unrestricted.

  true if the current permission is unrestricted; otherwise, false.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  The previous state of the current permission for the specified access type is overwritten. The following code sets the access for C:\temp to .

  code reference: System.Security.Permissions.FileIOPermission#12

  This access will not be overwritten by the following code because the access types are not the same.

  code reference: System.Security.Permissions.FileIOPermission#13

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

  A bitwise combination of the values. The absolute path of the file or directory.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  The previous state of the current permission for the specified access type is overwritten. The following code sets the access for C:\temp to .

  This access will not be overwritten by the following code because the access types are not the same.

  code reference: System.Security.Permissions.FileIOPermission#15

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

  A bitwise combination of the values. An array containing the absolute paths of the files and directories.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 To be added. To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.SecurityElement

  For the XML encoding for this class, see the class page.

  This method overrides .

  Creates an XML encoding of the permission and its current state.

  An XML encoding of the permission, including any state information.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission `` is not and is not of type .

  The result of a call to is a permission that represents all the operations represented by both the current permission and the specified permission. Any demand that passes either permission passes their union.

  Creates a permission that is the union of the current permission and the specified permission.

  A new permission that represents the union of the current permission and the specified permission.

  A permission to combine with the current permission. It must be the same type as the current permission. 0
0