The File class is used to work with files.
All methods of this class are static. Using these methods enables the user to create, delete, move and change files, also to work with file attributes and parameters that are responsible for the time of creation, change and the last access to a file. A work on files can be executed in the text and binary mode. It is recommended to use corresponding methods of the FileInfo class if a lot of operations on files are planned to be executed.
Method name | Brief description | |
The AppendBinary method opens a file for writing in a binary format and puts a cursor to the end of a file. | ||
The AppendText method opens a file for writing in a text format and puts a cursor to the end of a file. | ||
The Copy method copies a file. | ||
The Delete method deletes a file. | ||
The Exists method returns whether the file exists. | ||
The GetAttributes method returns file attributes. | ||
The GetCreationTime method returns date and time of file creation. | ||
The GetLastAccessTime method returns date and time of the last access to a file. | ||
The GetLastWriteTime method returns date and time of the last edit of a file. | ||
The Move method moves a file. | ||
The Open method opens a file with a specific query of file opening and parameters of shared access. | ||
The OpenBinaryReader method opens a file for reading in a binary format. | ||
The OpenBinaryWriter method opens a file for writing in a binary format and puts a cursor to the beginning of a file. | ||
The OpenTextReader method opens a file for reading in a text format. | ||
The OpenTextWriter method opens a file for writing in a text format and puts a cursor to the beginning of a file. | ||
The SetAttributes method changes file attributes. | ||
The SetCreationTime method changes date and time of a file creation. | ||
The SetLastAccessTime method changes date and time of the last access to a file. | ||
The SetLastWriteTime method sets date and time of the last edit of a file. |
See also: