Export (0) Print
Expand All
3 out of 10 rated this helpful - Rate this topic

File Members

Provides static methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects.

The File type exposes the following members.

  NameDescription
Public method Static member AppendAllText Overloaded. Appends the specified stringto the file, creating the file if it does not already exist.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework AppendText Creates a StreamWriter that appends UTF-8 encoded text to an existing file.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework Copy Overloaded. Copies an existing file to a new file.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework Create Overloaded. Creates a file in the specified path.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework CreateText Creates or opens a file for writing UTF-8 encoded text.
Public method Static member Decrypt Decrypts a file that was encrypted by the current account using the Encrypt method.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework Delete Deletes the specified file. An exception is not thrown if the specified file does not exist.
Public method Static member Encrypt Encrypts a file so that only the account used to encrypt the file can decrypt it.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework Exists Determines whether the specified file exists.
Public method Static member GetAccessControl Overloaded. Gets a FileSecurity object that encapsulates the access control list (ACL) entries for a specified file.
Public method Static member GetAttributes Gets the FileAttributes of the file on the path.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework GetCreationTime Returns the creation date and time of the specified file or directory.
Public method Static member GetCreationTimeUtc Returns the creation date and time, in coordinated universal time (UTC), of the specified file or directory.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework GetLastAccessTime Returns the date and time the specified file or directory was last accessed.
Public method Static member GetLastAccessTimeUtc Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework GetLastWriteTime Returns the date and time the specified file or directory was last written to.
Public method Static member GetLastWriteTimeUtc Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework Move Moves a specified file to a new location, providing the option to specify a new file name.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework Open Overloaded. Opens a FileStream on the specified path.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework OpenRead Opens an existing file for reading.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework OpenText Opens an existing UTF-8 encoded text file for reading.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework OpenWrite Opens an existing 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 ReadAllLines Overloaded. Opens a text file, reads all lines of the file into a string array, and then closes the file.
Public method Static member ReadAllText Overloaded. Opens a text file, reads all lines of the file into a string, and then closes the file.
Public method Static member Replace Overloaded. Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file.
Public method Static member SetAccessControl Applies access control list (ACL) entries described by a FileSecurity object to the specified file.
Public method Static member SetAttributes Sets the specified FileAttributes of the file on the specified path.
Public method Static member SetCreationTime Sets the date and time the file was created.
Public method Static member SetCreationTimeUtc Sets the date and time, in coordinated universal time (UTC), that the file was created.
Public method Static member SetLastAccessTime Sets the date and time the specified file was last accessed.
Public method Static member SetLastAccessTimeUtc Sets the date and time, in coordinated universal time (UTC), that the specified file was last accessed.
Public method Static member SetLastWriteTime Sets the date and time that the specified file was last written to.
Public method Static member SetLastWriteTimeUtc Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to.
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.
Public method Static member WriteAllLines Overloaded. Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.
Public method Static member WriteAllText Overloaded. Creates a new file, write the contents to the file, and then closes the file. If the target file already exists, it is overwritten.
Top
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.