Namespace: System.IO
FileInfo
Provides properties and instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects. This class cannot be inherited.
Properties (3)
String Name
Gets the name of the file.
Value: The name of the file.
String DirectoryName
Gets a string representing the directory's full path.
Value: A string representing the directory's full path.
bool Exists
Gets a value indicating whether a file exists.
Value: true if the file exists; false if the file does not exist or if the file is a directory.
Methods (2)
FileInfo(String)Constructor
Initializes a new instance of the FileInfo class, which acts as a wrapper for a file path.
| Parameter | Description |
|---|---|
| fileName | The fully qualified name of the new file, or the relative file name. Do not end the path with the directory separator character. |
void Delete
Permanently deletes a file.