File Methods
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
The File type exposes the following members.
| Name | Description | |
|---|---|---|
|
AppendText | Creates a StreamWriter that appends UTF-8 encoded text to an existing file. |
|
Copy(String, String) | Copies an existing file to a new file. Overwriting a file of the same name is not allowed. |
|
Copy(String, String, Boolean) | Copies an existing file to a new file. Overwriting a file of the same name is allowed. |
|
Create(String) | Creates or overwrites a file in the specified path. |
|
Create(String, Int32) | Creates or overwrites the specified file. |
|
CreateText | Creates or opens a file for writing UTF-8 encoded text. |
|
Delete | Deletes the specified file. An exception is not thrown if the specified file does not exist. |
|
Exists | Determines whether the specified file exists. |
|
GetCreationTime | Returns the creation date and time of the specified file or directory. |
|
GetLastAccessTime | Returns the date and time the specified file or directory was last accessed. |
|
GetLastWriteTime | Returns the date and time the specified file or directory was last written to. |
|
Move | Moves a specified file to a new location, providing the option to specify a new file name. |
|
Open(String, FileMode) | Opens a FileStream on the specified path with read/write access. |
|
Open(String, FileMode, FileAccess) | Opens a FileStream on the specified path, with the specified mode and access. |
|
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. |
|
OpenRead | Opens an existing file for reading. |
|
OpenText | Opens an existing UTF-8 encoded text file for reading. |
|
OpenWrite | Opens an existing file for writing. |
|
SetAttributes | Security Critical. Sets the specified FileAttributes of the file on the specified path. |
Show: