Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
System.IO Namespace
File Class
File Methods

  Switch on low bandwidth view
Members FilterMembers Filter
Frameworks FilterFrameworks Filter
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
File Methods

The File type exposes the following members.

  NameDescription
Public methodStatic memberAppendAllTextOverloaded. Appends the specified stringto the file, creating the file if it does not already exist.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAppendText Creates a StreamWriter that appends UTF-8 encoded text to an existing file.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkCopyOverloaded. Copies an existing file to a new file.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkCreateOverloaded. Creates a file in the specified path.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkCreateText Creates or opens a file for writing UTF-8 encoded text.
Public methodStatic memberDecrypt Decrypts a file that was encrypted by the current account using the Encrypt method.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkDelete Deletes the specified file. An exception is not thrown if the specified file does not exist.
Public methodStatic memberEncrypt Encrypts a file so that only the account used to encrypt the file can decrypt it.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkExists Determines whether the specified file exists.
Public methodStatic memberGetAccessControlOverloaded. Gets a FileSecurity object that encapsulates the access control list (ACL) entries for a specified file.
Public methodStatic memberGetAttributes Gets the FileAttributes of the file on the path.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetCreationTime Returns the creation date and time of the specified file or directory.
Public methodStatic memberGetCreationTimeUtc Returns the creation date and time, in coordinated universal time (UTC), of the specified file or directory.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetLastAccessTime Returns the date and time the specified file or directory was last accessed.
Public methodStatic memberGetLastAccessTimeUtc Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetLastWriteTime Returns the date and time the specified file or directory was last written to.
Public methodStatic memberGetLastWriteTimeUtc Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkMove Moves a specified file to a new location, providing the option to specify a new file name.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkOpenOverloaded. Opens a FileStream on the specified path.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkOpenRead Opens an existing file for reading.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkOpenText Opens an existing UTF-8 encoded text file for reading.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkOpenWrite Opens an existing file for writing.
Public methodStatic memberReadAllBytes Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
Public methodStatic memberReadAllLinesOverloaded. Opens a text file, reads all lines of the file into a string array, and then closes the file.
Public methodStatic memberReadAllTextOverloaded. Opens a text file, reads all lines of the file into a string, and then closes the file.
Public methodStatic memberReplaceOverloaded. 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 methodStatic memberSetAccessControl Applies access control list (ACL) entries described by a FileSecurity object to the specified file.
Public methodStatic memberSetAttributes Sets the specified FileAttributes of the file on the specified path.
Public methodStatic memberSetCreationTime Sets the date and time the file was created.
Public methodStatic memberSetCreationTimeUtc Sets the date and time, in coordinated universal time (UTC), that the file was created.
Public methodStatic memberSetLastAccessTime Sets the date and time the specified file was last accessed.
Public methodStatic memberSetLastAccessTimeUtc Sets the date and time, in coordinated universal time (UTC), that the specified file was last accessed.
Public methodStatic memberSetLastWriteTime Sets the date and time that the specified file was last written to.
Public methodStatic memberSetLastWriteTimeUtc Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to.
Public methodStatic memberWriteAllBytes 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 methodStatic memberWriteAllLinesOverloaded. 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 methodStatic memberWriteAllTextOverloaded. 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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker