File Methods

File Methods

 

Namespace:   System.IO
Assembly:  mscorlib (in mscorlib.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAppendAllLines(String, IEnumerable<String>)

Appends lines to a file, and then closes the file. If the specified file does not exist, this method creates a file, writes the specified lines to the file, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticAppendAllLines(String, IEnumerable<String>, Encoding)

Appends lines to a file by using a specified encoding, and then closes the file. If the specified file does not exist, this method creates a file, writes the specified lines to the file, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticAppendAllText(String, String)

Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticAppendAllText(String, String, Encoding)

Appends the specified string to the file, creating the file if it does not already exist.

System_CAPS_pubmethodSystem_CAPS_staticAppendText(String)

Creates a StreamWriter that appends UTF-8 encoded text to an existing file, or to a new file if the specified file does not exist.

System_CAPS_pubmethodSystem_CAPS_staticCopy(String, String)

Copies an existing file to a new file. Overwriting a file of the same name is not allowed.

System_CAPS_pubmethodSystem_CAPS_staticCopy(String, String, Boolean)

Copies an existing file to a new file. Overwriting a file of the same name is allowed.

System_CAPS_pubmethodSystem_CAPS_staticCreate(String)

Creates or overwrites a file in the specified path.

System_CAPS_pubmethodSystem_CAPS_staticCreate(String, Int32)

Creates or overwrites the specified file.

System_CAPS_pubmethodSystem_CAPS_staticCreate(String, Int32, FileOptions)

Creates or overwrites the specified file, specifying a buffer size and a FileOptions value that describes how to create or overwrite the file.

System_CAPS_pubmethodSystem_CAPS_staticCreate(String, Int32, FileOptions, FileSecurity)

Creates or overwrites the specified file with the specified buffer size, file options, and file security.

System_CAPS_pubmethodSystem_CAPS_staticCreateText(String)

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

System_CAPS_pubmethodSystem_CAPS_staticDecrypt(String)

Decrypts a file that was encrypted by the current account using the Encrypt method.

System_CAPS_pubmethodSystem_CAPS_staticDelete(String)

Deletes the specified file.

System_CAPS_pubmethodSystem_CAPS_staticEncrypt(String)

Encrypts a file so that only the account used to encrypt the file can decrypt it.

System_CAPS_pubmethodSystem_CAPS_staticExists(String)

Determines whether the specified file exists.

System_CAPS_pubmethodSystem_CAPS_staticGetAccessControl(String)

Gets a FileSecurity object that encapsulates the access control list (ACL) entries for a specified file.

System_CAPS_pubmethodSystem_CAPS_staticGetAccessControl(String, AccessControlSections)

Gets a FileSecurity object that encapsulates the specified type of access control list (ACL) entries for a particular file.

System_CAPS_pubmethodSystem_CAPS_staticGetAttributes(String)

Gets the FileAttributes of the file on the path.

System_CAPS_pubmethodSystem_CAPS_staticGetCreationTime(String)

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

System_CAPS_pubmethodSystem_CAPS_staticGetCreationTimeUtc(String)

Returns the creation date and time, in coordinated universal time (UTC), of the specified file or directory.

System_CAPS_pubmethodSystem_CAPS_staticGetLastAccessTime(String)

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

System_CAPS_pubmethodSystem_CAPS_staticGetLastAccessTimeUtc(String)

Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.

System_CAPS_pubmethodSystem_CAPS_staticGetLastWriteTime(String)

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

System_CAPS_pubmethodSystem_CAPS_staticGetLastWriteTimeUtc(String)

Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.

System_CAPS_pubmethodSystem_CAPS_staticMove(String, String)

Moves a specified file to a new location, providing the option to specify a new file name.

System_CAPS_pubmethodSystem_CAPS_staticOpen(String, FileMode)

Opens a FileStream on the specified path with read/write access.

System_CAPS_pubmethodSystem_CAPS_staticOpen(String, FileMode, FileAccess)

Opens a FileStream on the specified path, with the specified mode and access.

System_CAPS_pubmethodSystem_CAPS_staticOpen(String, FileMode, FileAccess, FileShare)

Opens a FileStream on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option.

System_CAPS_pubmethodSystem_CAPS_staticOpenRead(String)

Opens an existing file for reading.

System_CAPS_pubmethodSystem_CAPS_staticOpenText(String)

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

System_CAPS_pubmethodSystem_CAPS_staticOpenWrite(String)

Opens an existing file or creates a new file for writing.

System_CAPS_pubmethodSystem_CAPS_staticReadAllBytes(String)

Opens a binary file, reads the contents of the file into a byte array, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticReadAllLines(String)

Opens a text file, reads all lines of the file, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticReadAllLines(String, Encoding)

Opens a file, reads all lines of the file with the specified encoding, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticReadAllText(String)

Opens a text file, reads all lines of the file, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticReadAllText(String, Encoding)

Opens a file, reads all lines of the file with the specified encoding, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticReadLines(String)

Reads the lines of a file.

System_CAPS_pubmethodSystem_CAPS_staticReadLines(String, Encoding)

Read the lines of a file that has a specified encoding.

System_CAPS_pubmethodSystem_CAPS_staticReplace(String, String, String)

Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file.

System_CAPS_pubmethodSystem_CAPS_staticReplace(String, String, String, Boolean)

Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file and optionally ignores merge errors.

System_CAPS_pubmethodSystem_CAPS_staticSetAccessControl(String, FileSecurity)

Applies access control list (ACL) entries described by a FileSecurity object to the specified file.

System_CAPS_pubmethodSystem_CAPS_staticSetAttributes(String, FileAttributes)

Sets the specified FileAttributes of the file on the specified path.

System_CAPS_pubmethodSystem_CAPS_staticSetCreationTime(String, DateTime)

Sets the date and time the file was created.

System_CAPS_pubmethodSystem_CAPS_staticSetCreationTimeUtc(String, DateTime)

Sets the date and time, in coordinated universal time (UTC), that the file was created.

System_CAPS_pubmethodSystem_CAPS_staticSetLastAccessTime(String, DateTime)

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

System_CAPS_pubmethodSystem_CAPS_staticSetLastAccessTimeUtc(String, DateTime)

Sets the date and time, in coordinated universal time (UTC), that the specified file was last accessed.

System_CAPS_pubmethodSystem_CAPS_staticSetLastWriteTime(String, DateTime)

Sets the date and time that the specified file was last written to.

System_CAPS_pubmethodSystem_CAPS_staticSetLastWriteTimeUtc(String, DateTime)

Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to.

System_CAPS_pubmethodSystem_CAPS_staticWriteAllBytes(String, Byte[])

Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.

System_CAPS_pubmethodSystem_CAPS_staticWriteAllLines(String, IEnumerable<String>)

Creates a new file, writes a collection of strings to the file, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticWriteAllLines(String, IEnumerable<String>, Encoding)

Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticWriteAllLines(String, String[])

Creates a new file, write the specified string array to the file, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticWriteAllLines(String, String[], Encoding)

Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticWriteAllText(String, String)

Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.

System_CAPS_pubmethodSystem_CAPS_staticWriteAllText(String, String, Encoding)

Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.

Return to top
Show:
© 2016 Microsoft