Exposes static methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited.
The Directory type exposes the following members.
Methods
Name | Description | |
---|---|---|
CreateDirectory(String) | Creates all directories and subdirectories as specified by path. | |
CreateDirectory(String, DirectorySecurity) | Creates all the directories in the specified path, applying the specified Windows security. | |
Delete(String) | Deletes an empty directory from a specified path. | |
Delete(String, Boolean) | Deletes the specified directory and, if indicated, any subdirectories and files in the directory. | |
EnumerateDirectories(String) | Returns an enumerable collection of directory names in a specified path. | |
EnumerateDirectories(String, String) | Returns an enumerable collection of directory names that match a search pattern in a specified path. | |
EnumerateDirectories(String, String, SearchOption) | Returns an enumerable collection of directory names that match a search pattern in a specified path, and optionally searches subdirectories. | |
EnumerateFiles(String) | Returns an enumerable collection of file names in a specified path. | |
EnumerateFiles(String, String) | Returns an enumerable collection of file names that match a search pattern in a specified path. | |
EnumerateFiles(String, String, SearchOption) | Returns an enumerable collection of file names that match a search pattern in a specified path, and optionally searches subdirectories. | |
EnumerateFileSystemEntries(String) | Returns an enumerable collection of file-system entries in a specified path. | |
EnumerateFileSystemEntries(String, String) | Returns an enumerable collection of file-system entries that match a search pattern in a specified path. | |
EnumerateFileSystemEntries(String, String, SearchOption) | Returns an enumerable collection of file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories. | |
Exists | Determines whether the given path refers to an existing directory on disk. | |
GetAccessControl(String) | Gets a DirectorySecurity object that encapsulates the access control list (ACL) entries for a specified directory. | |
GetAccessControl(String, AccessControlSections) | Gets a DirectorySecurity object that encapsulates the specified type of access control list (ACL) entries for a specified directory. | |
GetCreationTime | Gets the creation date and time of a directory. | |
GetCreationTimeUtc | Gets the creation date and time, in Coordinated Universal Time (UTC) format, of a directory. | |
GetCurrentDirectory | Gets the current working directory of the application. | |
GetDirectories(String) | Gets the names of subdirectories in the specified directory. | |
GetDirectories(String, String) | Gets an array of directories matching the specified search pattern from the current directory. | |
GetDirectories(String, String, SearchOption) | Gets an array of directories matching the specified search pattern from the current directory, using a value to determine whether to search subdirectories. | |
GetDirectoryRoot | Returns the volume information, root information, or both for the specified path. | |
GetFiles(String) | Returns the names of files (including their paths) in the specified directory. | |
GetFiles(String, String) | Returns the names of files (including their paths) that match the specified search pattern in the specified directory. | |
GetFiles(String, String, SearchOption) | Returns the names of files (including their paths) that match the specified search pattern in the specified directory, using a value to determine whether to search subdirectories. | |
GetFileSystemEntries(String) | Returns the names of all files and subdirectories in the specified directory. | |
GetFileSystemEntries(String, String) | Returns an array of file system entries that match the specified search criteria. | |
GetFileSystemEntries(String, String, SearchOption) | Gets an array of all the file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories. | |
GetLastAccessTime | Returns the date and time the specified file or directory was last accessed. | |
GetLastAccessTimeUtc | Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last accessed. | |
GetLastWriteTime | Returns the date and time the specified file or directory was last written to. | |
GetLastWriteTimeUtc | Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last written to. | |
GetLogicalDrives | Retrieves the names of the logical drives on this computer in the form "<drive letter>:\". | |
GetParent | Retrieves the parent directory of the specified path, including both absolute and relative paths. | |
Move | Moves a file or a directory and its contents to a new location. | |
SetAccessControl | Applies access control list (ACL) entries described by a DirectorySecurity object to the specified directory. | |
SetCreationTime | Sets the creation date and time for the specified file or directory. | |
SetCreationTimeUtc | Sets the creation date and time, in Coordinated Universal Time (UTC) format, for the specified file or directory. | |
SetCurrentDirectory | Sets the application's current working directory to the specified directory. | |
SetLastAccessTime | Sets the date and time the specified file or directory was last accessed. | |
SetLastAccessTimeUtc | Sets the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last accessed. | |
SetLastWriteTime | Sets the date and time a directory was last written to. | |
SetLastWriteTimeUtc | Sets the date and time, in Coordinated Universal Time (UTC) format, that a directory was last written to. |