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 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Object

Provides information and performs operations on files .

Implementations of this class are required to preserve the case of path strings. Implementations are required to be case sensitive if and only if the platform is case-sensitive.

The following table describes the enumerations that are used to customize the behavior of various methods.

Enumeration
Description
Specifies read and write access to a file.
Specifies the level of access permitted for a file that is already in use.
Specifies whether the contents of an existing file are preserved or overwritten, and whether requests to create an existing file cause an exception.
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.IO.StreamWriter `` A containing the name of the file to append to.

  Appends UTF-8 encoded text to an existing file.

  A that appends UTF-8 encoded text to the specified file.

  This method is equivalent to (, ). If the file specified by does not exist, it is created. If the file does exist, writes to the append text to the file. Additional threads are permitted to read the file while it is open.

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  The caller does not have the required permission. is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. was not found. is . The directory information specified in was not found. The length of or the absolute path information for exceeds the implementation-specific maximum length. Requires permission to write to the specified file. See . A general I/O exception occurred, such as trying to access a CD-ROM drive whose tray is open. is in an implementation-specific invalid format. Access is denied. The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` A containing the name of the file to copy. A containing the name of the destination file. Cannot specify a directory or an existing file.

  Copies the specified file to a new location.

  This method is equivalent to (, , ).

  The and arguments are permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  exists.

  -or-

  An I/O error occurred.

  or is .

  or is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.

  -or-

  or specifies a directory.

  The caller does not have the required permission. Directory information in or was not found. was not found. The length or the absolute path information for or exceeds the system-defined maximum length. Requires permission to read the source file and write the destination file. See and . The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` `` A containing the name of the file to copy. A containing the name of the destination file. Cannot specify the name of a directory. A value. Specify if the destination file can be overwritten; otherwise .

  Copies the specified file to a new location.

  The and arguments are permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  is read-only (write-protected), or exists and is .

  -or-

  An I/O error occurred.

  or is .

  or is a zero-length string, contains only white space, or contains one or more invalid characters.

  -or-

  or specifies a directory.

  The caller does not have the required permission. Directory information in or was not found. was not found. The length or the absolute path information for or exceeds the system-defined maximum length. Requires permission to read the source file and write the destination file. See and . The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.IO.FileStream `` A containing the name of the file.

  Creates or overwrites the specified file.

  A that provides read/write access to the specified file.

  If the specified file does not exist, it is created; if it does exist and it is not read-only, the contents are overwritten.

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  The caller does not have the required permission.

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.

  is . The directory information specified in was not found. An I/O error occurred while creating the file. The caller does not have the required permission. The length of or the absolute path information for exceeds the system-defined maximum length. Requires permission to write the specified file. See . 0 1.0.5000.0 2.0.0.0
- Method
  System.IO.FileStream `` `` A containing the name of the file. A containing the number of bytes buffered for reads and writes to the file.

  Creates or overwrites the specified file.

  A that provides read/write access to the specified file.

  This method is equivalent to (, , , , ).

  If the specified file does not exist, it is created; if it does exist and it is not read-only, the contents are overwritten.

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  The caller does not have the required permission.

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.

  is . The directory information specified in was not found. An I/O error occurred while creating the file. The caller does not have the required permission. The length of or the absolute path information for exceeds the system-defined maximum length. Requires permission to write the specified file. See . 0 1.0.5000.0 2.0.0.0
- Method
  System.IO.FileStream `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.IO.FileStream `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.IO.StreamWriter `` The file to be opened for writing.

  Creates or opens a file for writing UTF-8 encoded text.

  A that writes to the specified file using UTF-8 encoding.

  This method is equivalent to (, ). If the file specified by does not exist, it is created. If the file does exist, its contents are overwritten. Additional threads are permitted to read the file while it is open.

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  The caller does not have the required permission. is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. is . The directory information specified in was not found. The length of or the absolute path information for exceeds the implementation-specific maximum length. Requires permission to write the specified file. See . A general I/O exception occurred, such as trying to access a CD-ROM drive whose tray is open. is in an implementation-specific invalid format. Access is denied. The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` A containing the name of the file to be deleted.

  Deletes the specified file.

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  Some implementations might throw to cover such implementation-specific conditions as "file in use".

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. is . The directory information specified in was not found. The specified file is in use. The caller does not have the required permission. The caller does not have the required permission. The length of or the absolute path information for exceeds the system-defined maximum length. Requires permission to write to the specified file. See . 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` To be added. To be added. To be added. 2.0.0.0
- Method
  System.Boolean `` A containing the name of the file to check.

  Returns a indicating whether the specified file exists.

  if the caller has the required permissions and contains the name of an existing file; otherwise, . If is or a zero-length string, returns .

  If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns regardless of the existence of .

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  Requires permission to read the specified file. See . 0 1.0.5000.0 2.0.0.0
- Method
  System.Security.AccessControl.FileSecurity `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Security.AccessControl.FileSecurity `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.IO.FileAttributes `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  System.DateTime `` A containing the name of the file or directory for which to obtain creation date and time information.

  Returns the creation date and time of the specified file or directory.

  A structure set to the creation date and time for the specified file or directory. This value is expressed in local time.

  Platforms that do not support this feature return .

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. is . was not found. The length of or the absolute path information for exceeds the system-defined maximum length. The caller does not have the required permission. Requires permission to read the specified file or directory. See . The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.DateTime `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  System.DateTime `` A containing the name of the file or directory for which to obtain access date and time information.

  Returns the date and time the specified file or directory was last accessed.

  A structure set to the date and time the specified file or directory was last accessed. This value is expressed in local time.

  Platforms that do not support this feature return .

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. is . was not found. The length of or the absolute path information for exceeds the system-defined maximum length. The caller does not have the required permission. Requires permission to read the specified file or directory. See . The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.DateTime `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  System.DateTime `` A containing the name of the file for which to obtain write date and time information.

  Returns the date and time the specified file or directory was last written to.

  A structure set to the date and time the specified file or directory was last written to. This value is expressed in local time.

  Platforms that do not support this feature return .

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. is . was not found. The length of or the absolute path information for exceeds the system-defined maximum length. The caller does not have the required permission. Requires permission to read the specified file or directory. See . The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.DateTime `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` A containing the name of the file to move. A containing the name of the new location for the file.

  Moves the specified file to a new location.

  This method does not throw an exception if the source and destination are the same.

  The and arguments are permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  already exists or is a directory. or is .

  or is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.

  The caller does not have the required permission. The directory information in or was not found. was not found or specifies a directory. The length or absolute path information for or exceeds the system-defined maximum length. Requires permission to read from and write to and . See and . The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.IO.FileStream `` `` A containing the name of the file to open. A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. To be added.

  Opens a on the specified file with read/write access.

  A that provides read/write access to the specified file.

  This method is equivalent to (, , , ).

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  The caller does not have the required permission.

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.

  was not found. is . specified an invalid value. The directory information specified in was not found. An I/O error occurred while opening the file. The caller does not have the required permission. The length of or the absolute path information for exceeds the system-defined maximum length. Requires permission to read and write the file. See and . 0 1.0.5000.0 2.0.0.0
- Method
  System.IO.FileStream `` `` `` A containing the name of the file to open. A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. A value that specifies the operations that can be performed on the file. To be added. To be added.

  Opens a on the specified file.

  A that provides access to the specified file.

  This method is equivalent to (, , , ).

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  The caller does not have the required permission.

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.

  -or-

  specified and specified , , or .

  is or , but the specified file was not found. If a different mode is specified and the file was not found, a new one is created. is . or specified an invalid value. The directory information specified in was not found. An I/O error occurred, such as specifying when the file specified by path already exists. specified a read-only file and is not , or specified a directory. The length of or the absolute path information for exceeds the system-defined maximum length. Requires permission to read and might also require permission to write to the file. See and . 0 1.0.5000.0 2.0.0.0
- Method
  System.IO.FileStream `` `` `` `` A containing the name of the file to open. A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. A value that specifies the operations that can be performed on the file. A value specifying the type of access other threads have to the file. To be added. To be added. To be added.

  Opens a on the specified file.

  A that provides access to the specified file.

  This method is equivalent to (, , , ).

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  The caller does not have the required permission.

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.

  -or-

  specified and specified , , or .

  was not found. is . , , or specified an invalid value. The directory information specified in was not found. An I/O error occurred while opening the file. The caller does not have the required permission. The length of or the absolute path information for exceeds the system-defined maximum length. Requires permission to read and might also require permission to write the file. See and . 0 1.0.5000.0 2.0.0.0
- Method
  System.IO.FileStream `` A containing the name of the file to be opened for reading.

  Opens an existing file for reading.

  A read-only containing the contents of the specified file.

  This method is equivalent to (, , , ).

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  The caller does not have the required permission. is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. was not found. is . The directory information specified in was not found. The caller does not have the required permission. The length of or the absolute path information for exceeds the system-defined maximum length. Requires permission to read the specified file. See . 0 1.0.5000.0 2.0.0.0
- Method
  System.IO.StreamReader `` A containing the name of the file to be opened for reading.

  Opens an existing UTF-8 encoded text file for reading.

  A containing the contents of the specified file.

  This method is equivalent to ().

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  The caller does not have the required permission. is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. was not found. is . The directory information specified in was not found. The length of or the absolute path information for exceeds the system-defined maximum length. Requires permission to write to the specified file. See . The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.IO.FileStream `` A containing the name of the file to be opened for writing.

  Opens an existing file for writing.

  A writable that writes to the file specified by .

  This method is equivalent to (, , , ).

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  The caller does not have the required permission. is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. was not found. is . The directory information specified in was not found. The caller does not have the required permission. The length of or the absolute path information for exceeds the system-defined maximum length. Requires permission to write the specified file. See . 0 1.0.5000.0 2.0.0.0
- Method
  System.Byte[] `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.String[] `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.String[] `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.String `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.String `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` A containing the name of the file for which to set the creation date and time information. A containing the value to set for the creation date and time of . This value is expressed in local time.

  Sets the creation date and time for the specified file.

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  On platforms that do not support this feature, this method has no effect. If this feature is supported, the range of dates that is valid for this operation is implementation-specific.

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. specifies a value outside the range of date/times permitted for this operation. is . was not found. An I/O error occurred while performing the operation. The length of or the absolute path information for exceeds the system-defined maximum length. Requires permission to write to the specified file or directory. See . The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` A containing the name of the file for which to set the access date and time information. A containing the value to set for the access date and time of . This value is expressed in local time.

  Sets the date and time the specified file was last accessed.

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  On platforms that do not support this feature, this method has no effect. If this feature is supported, the range of dates that is valid for this operation is implementation-specific.

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. is . An I/O error occurred while performing the operation. The length of or the absolute path information for exceeds the system-defined maximum length. The caller does not have the required permission. Requires permission to write to the specified file. See . specifies a value outside the range of date/times permitted for this operation. was not found. The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` A containing the name of the file for which to set the date and time information. A containing the value to set for the last write date and time of . This value is expressed in local time.

  Sets the date and time a file was last written to.

  The argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .

  On platforms that do not support this feature, this method has no effect. If this feature is supported, the range of dates that is valid for this operation is implementation-specific.

  is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. is . An I/O error occurred while performing the operation. The length of or the absolute path information for exceeds the system-defined maximum length. The caller does not have the required permission. Requires permission to write to the specified file. See . specifies a value outside the range of date/times permitted for this operation. was not found. The caller does not have the required permission. 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
0 System.Runtime.InteropServices.ComVisible(true)