[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Exposes static methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited.
Assembly: System.IO (in System.IO.dll)
Thetype exposes the following members.
|CreateDirectory||Creates all directories and subdirectories in the specified path.|
|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||Returns an enumerable collection of directory names in a specified path.|
|EnumerateFiles||Returns an enumerable collection of file names in a specified path.|
|EnumerateFileSystemEntries||Returns an enumerable collection of file-system entries in a specified path.|
|Equals(Object)||Determines whether the specified Object is equal to the current Object. (Inherited from Object.)|
|Exists||Determines whether the given path refers to an existing directory on disk.|
|GetCurrentDirectory||Gets the current working directory of the application.|
|GetDirectories||Gets the names of subdirectories (including their paths) in the specified directory.|
|GetFiles||Returns the names of files (including their paths) in the specified directory.|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|Move||Moves a file or a directory and its contents to a new location.|
|SetCurrentDirectory||Sets the application's current working directory to the specified directory.|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
Use the class for typical operations such as copying, moving, renaming, creating, and deleting directories. You can also use the class to get and set DateTime information related to the creation, access, and writing of a directory.
Because all methods are static, it might be more efficient to use a method rather than a corresponding DirectoryInfo instance method if you want to perform only one action. Most methods require the path to the directory that you are manipulating.
The static methods of the class perform security checks on all methods. If you are going to reuse an object several times, consider using the corresponding instance method of DirectoryInfo instead, because the security check will not always be necessary.