Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
System.IO Namespace
File Class
File Methods
Collapse All/Expand All Collapse All
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 FrameworkAppendTextCreates 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 FrameworkCreateTextCreates or opens a file for writing UTF-8 encoded text.
Public methodStatic memberDecryptDecrypts a file that was encrypted by the current account using the Encrypt method.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkDeleteDeletes the specified file. An exception is not thrown if the specified file does not exist.
Public methodStatic memberEncryptEncrypts 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 FrameworkExistsDetermines 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 memberGetAttributesGets the FileAttributes of the file on the path.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetCreationTimeReturns the creation date and time of the specified file or directory.
Public methodStatic memberGetCreationTimeUtcReturns 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 FrameworkGetLastAccessTimeReturns the date and time the specified file or directory was last accessed.
Public methodStatic memberGetLastAccessTimeUtcReturns 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 FrameworkGetLastWriteTimeReturns the date and time the specified file or directory was last written to.
Public methodStatic memberGetLastWriteTimeUtcReturns 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 FrameworkMoveMoves 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 FrameworkOpenReadOpens an existing file for reading.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkOpenTextOpens an existing UTF-8 encoded text file for reading.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkOpenWriteOpens an existing file for writing.
Public methodStatic memberReadAllBytesOpens 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 memberSetAccessControlApplies access control list (ACL) entries described by a FileSecurity object to the specified file.
Public methodStatic memberSetAttributesSets the specified FileAttributes of the file on the specified path.
Public methodStatic memberSetCreationTimeSets the date and time the file was created.
Public methodStatic memberSetCreationTimeUtcSets the date and time, in coordinated universal time (UTC), that the file was created.
Public methodStatic memberSetLastAccessTimeSets the date and time the specified file was last accessed.
Public methodStatic memberSetLastAccessTimeUtcSets the date and time, in coordinated universal time (UTC), that the specified file was last accessed.
Public methodStatic memberSetLastWriteTimeSets the date and time that the specified file was last written to.
Public methodStatic memberSetLastWriteTimeUtcSets the date and time, in coordinated universal time (UTC), that the specified file was last written to.
Public methodStatic memberWriteAllBytesCreates 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