This topic has not yet been rated - Rate this topic

File Methods

April 12, 2014

The File type exposes the following members.

  NameDescription
Public method Static member AppendText Creates a StreamWriter that appends UTF-8 encoded text to an existing file.
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 CreateText Creates or opens a file for writing UTF-8 encoded text.
Public method Static member Delete Deletes the specified file. An exception is not thrown if the specified file does not exist.
Public method Static member Exists Determines whether the specified file exists.
Public method Static member GetCreationTime Returns the creation date and time of the specified file or directory.
Public method Static member GetLastAccessTime Returns the date and time the specified file or directory was last accessed.
Public method Static member GetLastWriteTime Returns the date and time the specified file or directory was last written to.
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 OpenText Opens an existing UTF-8 encoded text file for reading.
Public method Static member OpenWrite Opens an existing file for writing.
Public method Static member SetAttributes Security Critical. Sets the specified FileAttributes of the file on the specified path.
Top

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.