Export (0) Print
Expand All
0 out of 8 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 following tables list the members exposed by the File type.

  Name Description
Public method Static AppendAllText Overloaded. Appends the specified stringto the file, creating the file if it does not already exist.
Public method Static 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 Supported by the .NET Compact Framework Supported by the XNA Framework Copy Overloaded. Copies an existing file to a new file.
Public method Static Supported by the .NET Compact Framework Supported by the XNA Framework Create Overloaded. Creates a file in the specified path.
Public method Static 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 Decrypt Decrypts a file that was encrypted by the current account using the Encrypt method.
Public method Static 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 Encrypt Encrypts a file so that only the account used to encrypt the file can decrypt it.
Public method Supported by the .NET Compact Framework Supported by the XNA Framework Equals  Overloaded. Determines whether two Object instances are equal. (inherited from Object)
Public method Static Supported by the .NET Compact Framework Supported by the XNA Framework Exists Determines whether the specified file exists.
Public method Static GetAccessControl Overloaded. Gets a FileSecurity object that encapsulates the access control list (ACL) entries for a specified file.
Public method Static GetAttributes Gets the FileAttributes of the file on the path.
Public method Static 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 GetCreationTimeUtc Returns the creation date and time, in coordinated universal time (UTC), of the specified file or directory.
Public method Supported by the .NET Compact Framework Supported by the XNA Framework GetHashCode  Serves as a hash function for a particular type. (inherited from Object)
Public method Static 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 GetLastAccessTimeUtc Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.
Public method Static 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 GetLastWriteTimeUtc Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.
Public method Supported by the .NET Compact Framework Supported by the XNA Framework GetType  Gets the Type of the current instance. (inherited from Object)
Public method Static 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 Supported by the .NET Compact Framework Supported by the XNA Framework Open Overloaded. Opens a FileStream on the specified path.
Public method Static Supported by the .NET Compact Framework Supported by the XNA Framework OpenRead Opens an existing file for reading.
Public method Static 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 Supported by the .NET Compact Framework Supported by the XNA Framework 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 ReadAllLines Overloaded. Opens a text file, reads all lines of the file into a string array, and then closes the file.
Public method Static ReadAllText Overloaded. Opens a text file, reads all lines of the file into a string, and then closes the file.
Public method Static Supported by the .NET Compact Framework ReferenceEquals  Determines whether the specified Object instances are the same instance. (inherited from Object)
Public method Static 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 SetAccessControl Applies access control list (ACL) entries described by a FileSecurity object to the specified file.
Public method Static SetAttributes Sets the specified FileAttributes of the file on the specified path.
Public method Static SetCreationTime Sets the date and time the file was created.
Public method Static SetCreationTimeUtc Sets the date and time, in coordinated universal time (UTC), that the file was created.
Public method Static SetLastAccessTime Sets the date and time the specified file was last accessed.
Public method Static SetLastAccessTimeUtc Sets the date and time, in coordinated universal time (UTC), that the specified file was last accessed.
Public method Static SetLastWriteTime Sets the date and time that the specified file was last written to.
Public method Static SetLastWriteTimeUtc Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to.
Public method Supported by the .NET Compact Framework Supported by the XNA Framework ToString  Returns a String that represents the current Object. (inherited from Object)
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.
Public method Static 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 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.