File Methods

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

The File type exposes the following members.

  Name Description
Public method Static member Copy(String, String) Copies an existing file to a new file. Overwriting a file of the same name is not allowed.
Public method Static member Copy(String, String, Boolean) Copies an existing file to a new file. Overwriting a file of the same name is allowed.
Public method Static member Create(String) Creates or overwrites a file in the specified path.
Public method Static member Create(String, Int32) Creates or overwrites the specified file.
Public method Static member Delete Deletes the specified file.
Public method Static member Exists Determines whether the specified file exists.
Public method Static member GetAttributes Gets the FileAttributes of the file on the path.
Public method Static member Move Moves a specified file to a new location, providing the option to specify a new file name.
Public method Static member Open(String, FileMode) Opens a FileStream on the specified path with read/write access.
Public method Static member Open(String, FileMode, FileAccess) Opens a FileStream on the specified path, with the specified mode and access.
Public method Static member Open(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.
Public method Static member OpenRead Opens an existing file for reading.
Public method Static member OpenWrite Opens an existing file or creates a new file for writing.
Public method Static member ReadAllBytes Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
Public method Static member SetAttributes Sets the specified FileAttributes of the file on the specified path.
Public method Static member 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.
Top
Show: