Export (0) Print
Expand All

Directory Methods

The Directory type exposes the following members.

  Name Description
Public method Static member CreateDirectory(String) Creates all directories and subdirectories in the specified path unless they already exist.
Public method Static member CreateDirectory(String, DirectorySecurity) Creates all the directories in the specified path, unless the already exist, applying the specified Windows security.
Public method Static member Delete(String) Deletes an empty directory from a specified path.
Public method Static member Delete(String, Boolean) Deletes the specified directory and, if indicated, any subdirectories and files in the directory.
Public method Static member EnumerateDirectories(String) Returns an enumerable collection of directory names in a specified path.
Public method Static member EnumerateDirectories(String, String) Returns an enumerable collection of directory names that match a search pattern in a specified path.
Public method Static member EnumerateDirectories(String, String, SearchOption) Returns an enumerable collection of directory names that match a search pattern in a specified path, and optionally searches subdirectories.
Public method Static member EnumerateFiles(String) Returns an enumerable collection of file names in a specified path.
Public method Static member EnumerateFiles(String, String) Returns an enumerable collection of file names that match a search pattern in a specified path.
Public method Static member EnumerateFiles(String, String, SearchOption) Returns an enumerable collection of file names that match a search pattern in a specified path, and optionally searches subdirectories.
Public method Static member EnumerateFileSystemEntries(String) Returns an enumerable collection of file names and directory names in a specified path.
Public method Static member EnumerateFileSystemEntries(String, String) Returns an enumerable collection of file names and directory names that match a search pattern in a specified path.
Public method Static member 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.
Public method Static member Exists Determines whether the given path refers to an existing directory on disk.
Public method Static member GetAccessControl(String) Gets a DirectorySecurity object that encapsulates the access control list (ACL) entries for a specified directory.
Public method Static member GetAccessControl(String, AccessControlSections) Gets a DirectorySecurity object that encapsulates the specified type of access control list (ACL) entries for a specified directory.
Public method Static member GetCreationTime Gets the creation date and time of a directory.
Public method Static member GetCreationTimeUtc Gets the creation date and time, in Coordinated Universal Time (UTC) format, of a directory.
Public method Static member GetCurrentDirectory Gets the current working directory of the application.
Public method Static member GetDirectories(String) Returns the names of subdirectories (including their paths) in the specified directory.
Public method Static member GetDirectories(String, String) Returns the names of subdirectories (including their paths) that match the specified search pattern in the specified directory.
Public method Static member GetDirectories(String, String, SearchOption) Returns the names of the subdirectories (including their paths) that match the specified search pattern in the specified directory, and optionally searches subdirectories.
Public method Static member GetDirectoryRoot Returns the volume information, root information, or both for the specified path.
Public method Static member GetFiles(String) Returns the names of files (including their paths) in the specified directory.
Public method Static member GetFiles(String, String) Returns the names of files (including their paths) that match the specified search pattern in the specified directory.
Public method Static member 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.
Public method Static member GetFileSystemEntries(String) Returns the names of all files and subdirectories in a specified path.
Public method Static member GetFileSystemEntries(String, String) Returns an array of file names and directory names that that match a search pattern in a specified path.
Public method Static member GetFileSystemEntries(String, String, SearchOption) Returns an array of all the file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories.
Public method Static member GetLastAccessTime Returns the date and time the specified file or directory was last accessed.
Public method Static member GetLastAccessTimeUtc Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last accessed.
Public method Static member GetLastWriteTime Returns the date and time the specified file or directory was last written to.
Public method Static member GetLastWriteTimeUtc Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last written to.
Public method Static member GetLogicalDrives Retrieves the names of the logical drives on this computer in the form "<drive letter>:\".
Public method Static member GetParent Retrieves the parent directory of the specified path, including both absolute and relative paths.
Public method Static member Move Moves a file or a directory and its contents to a new location.
Public method Static member SetAccessControl Applies access control list (ACL) entries described by a DirectorySecurity object to the specified directory.
Public method Static member SetCreationTime Sets the creation date and time for the specified file or directory.
Public method Static member SetCreationTimeUtc Sets the creation date and time, in Coordinated Universal Time (UTC) format, for the specified file or directory.
Public method Static member SetCurrentDirectory Sets the application's current working directory to the specified directory.
Public method Static member SetLastAccessTime Sets the date and time the specified file or directory was last accessed.
Public method Static member SetLastAccessTimeUtc Sets the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last accessed.
Public method Static member SetLastWriteTime Sets the date and time a directory was last written to.
Public method Static member SetLastWriteTimeUtc Sets the date and time, in Coordinated Universal Time (UTC) format, that a directory was last written to.
Top
Show:
© 2014 Microsoft