← Interactive API Explorer
Namespace: System.IO

DirectoryInfo

Exposes instance methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited.

Properties (3)

bool Exists
Gets a value indicating whether the directory exists.
Value: true if the directory exists; otherwise, false.
String Name
Gets the name of this DirectoryInfo instance.
Value: The directory name.
String FullName
Gets the full path of the directory.
Value: A string containing the full path.

Methods (3)

DirectoryInfo(String)Constructor
Initializes a new instance of the DirectoryInfo class on the specified path.
ParameterDescription
pathA string specifying the path on which to create the DirectoryInfo.
FileInfo[] GetFiles
Returns a file list from the current directory.
Returns: An array of type FileInfo.
DirectoryInfo[] GetDirectories
Returns the subdirectories of the current directory.
Returns: An array of DirectoryInfo objects.