The FileInfo class implements an object that is used to work with files.
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. It is recommended to use corresponding static method of the File class if only one operation is planned.
Constructor name | Brief description | |
The Attach constructor creates an object that is used to work with files and links it to the specified file. |
Property name |
Brief description | |
The Directory property returns description of the directory, in which a file is located. | ||
The DirectoryName property returns the full path and name of the directory, in which a file is located. | ||
The Size property returns a file size (up to 2 Gb) in bytes. | ||
The Size property returns a file size in bytes. |
Property name | Brief description | |
The Attributes property determines file attributes. | ||
The CreationTime property determines date and time of file creation. | ||
The Exists property returns whether a file exists. | ||
The Extension property returns a file extension including ".". | ||
The FullName property returns a full path and a file name. | ||
The LastAccessTime property determines date and time of the last file opening. | ||
The LastWriteTime property determines date and time of the last file edit. | ||
The Name property returns file name. |
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 CopyTo method copies a file to a directory. | ||
The MoveTo method moves a file to a directory. | ||
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. |
Method name | Brief description | |
The Delete method deletes a file. |
See also: