File

Description

The File class is used to work with files.

Comments

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.

Static class methods inherited from IFile

  Method name Brief description
AppendBinary

The AppendBinary method opens a file for writing in a binary format and puts a cursor to the end of a file.
AppendText

The AppendText method opens a file for writing in a text format and puts a cursor to the end of a file.
Copy

The Copy method copies a file.
Delete

The Delete method deletes a file.
Exists

The Exists method returns whether the file exists.
GetAttributes

The GetAttributes method returns file attributes.
GetCreationTime

The GetCreationTime method returns date and time of file creation.
GetLastAccessTime

The GetLastAccessTime method returns date and time of the last access to a file.
GetLastWriteTime

The GetLastWriteTime method returns date and time of the last edit of a file.
Move

The Move method moves a file.
Open

The Open method opens a file with a specific query of file opening and parameters of shared access.
OpenBinaryReader

The OpenBinaryReader method opens a file for reading in a binary format.
OpenBinaryWriter

The OpenBinaryWriter method opens a file for writing in a binary format and puts a cursor to the beginning of a file.
OpenTextReader

The OpenTextReader method opens a file for reading in a text format.
OpenTextWriter

The OpenTextWriter method opens a file for writing in a text format and puts a cursor to the beginning of a file.
SetAttributes

The SetAttributes method changes file attributes.
SetCreationTime

The SetCreationTime method changes date and time of a file creation.
SetLastAccessTime

The SetLastAccessTime method changes date and time of the last access to a file.
SetLastWriteTime

The SetLastWriteTime method sets date and time of the last edit of a file.

See also:

IO Assembly Classes