FileInfo Methods

Include Protected Members
Include Inherited Members

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

The FileInfo type exposes the following members.

Methods

  Name Description
AppendText Creates a StreamWriter that appends text to the file represented by this instance of the FileInfo.
CopyTo(String) Copies an existing file to a new file, disallowing the overwriting of an existing file.
CopyTo(String, Boolean) Copies an existing file to a new file, allowing the overwriting of an existing file.
Create Creates a file.
CreateText Creates a StreamWriter that writes a new text file.
Delete Permanently deletes a file. (Overrides FileSystemInfo..::.Delete()()().)
Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
GetType Gets the Type of the current instance. (Inherited from Object.)
MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
MoveTo Moves a specified file to a new location, providing the option to specify a new file name.
Open(FileMode) Opens a file in the specified mode.
Open(FileMode, FileAccess) Opens a file in the specified mode with read, write, or read/write access.
Open(FileMode, FileAccess, FileShare) Opens a file in the specified mode with read, write, or read/write access and the specified sharing option.
OpenRead Creates a read-only FileStream.
OpenText Creates a StreamReader with UTF8 encoding that reads from an existing text file.
OpenWrite Creates a write-only FileStream.
Refresh Refreshes the state of the object. (Inherited from FileSystemInfo.)
ToString Returns the path as a string. (Overrides Object..::.ToString()()().)

Top

See Also

Reference

FileInfo Class

System.IO Namespace