| FileInfo Class |
Namespace: System.IO
[SerializableAttribute] public sealed class FileInfo : FileSystemInfo
The FileInfo type exposes the following members.
| Name | Description | |
|---|---|---|
| Create | Creates a file. | |
| Delete | Permanently deletes a file. (Overrides FileSystemInfoDelete.) | |
| Equals(Object) | (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.) | |
| 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 ObjectToString.) |
| Name | Description | |
|---|---|---|
| Exists | Gets a value indicating whether the file or directory exists. (Inherited from FileSystemInfo.) | |
| Extension | Gets the string representing the extension part of the file. (Inherited from FileSystemInfo.) | |
| FullName | Gets the full path of the directory or file. (Inherited from FileSystemInfo.) | |
| Name | For files, gets the name of the file. For directories, gets the name of the last directory in the hierarchy if a hierarchy exists. Otherwise, the Name property gets the name of the directory. (Inherited from FileSystemInfo.) |