Share via


File Members

The following tables list the members exposed by the File type.

Public Methods

Name Description
Public Method Static Copy Copies an existing file to a new file.
Public Method Static Create Creates or overwrites the specified file.
Public Method Static Delete Deletes the specified file. An exception is not thrown if the specified file does not exist.
Public Method Static Exists Determines whether the specified file exists.
Public Method Static GetAttributes Gets the FileAttributes of the file on the path.
Public Method Static Move Moves a specified file to a new location, providing the option to specify a new file name.
Public Method Static Open Opens a FileStream on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option.
Public Method Static OpenRead Opens an existing file for reading.
Public Method Static OpenWrite Opens an existing file for writing.
Public Method Static ReadAllBytes Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
Public Method Static SetAttributes Sets the specified FileAttributes of the file on the specified path.
Public Method Static WriteAllBytes 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.

See Also

Reference

File Class
System.IO Namespace