System.IO.Directory: Method Members

The methods of System.IO.Directory are listed below. For a list of all members, see the Directory Members list.

See Also: Inherited members from System.Object

Public Methods

static
CreateDirectory(string) : DirectoryInfo

Creates all directories and subdirectories in the specified path unless they already exist.

static
CreateDirectory(string, System.Security.AccessControl.DirectorySecurity) : DirectoryInfo

Creates all the directories in the specified path, unless the already exist, applying the specified Windows security.

static
Delete(string)

Deletes an empty directory from a specified path.

static
Delete(string, bool)

Deletes the specified directory and, if indicated, any subdirectories and files in the directory.

static
EnumerateDirectories(string) : IEnumerable<string>

Returns an enumerable collection of directory names in a specified path.

static
EnumerateDirectories(string, string) : IEnumerable<string>

Returns an enumerable collection of directory names that match a search pattern in a specified path.

static
EnumerateDirectories(string, string, SearchOption) : IEnumerable<string>

Returns an enumerable collection of directory names that match a search pattern in a specified path, and optionally searches subdirectories.

static
EnumerateFiles(string) : IEnumerable<string>

Returns an enumerable collection of file names in a specified path.

static
EnumerateFiles(string, string) : IEnumerable<string>

Returns an enumerable collection of file names that match a search pattern in a specified path.

static
EnumerateFiles(string, string, SearchOption) : IEnumerable<string>

Returns an enumerable collection of file names that match a search pattern in a specified path, and optionally searches subdirectories.

static
EnumerateFileSystemEntries(string) : IEnumerable<string>

Returns an enumerable collection of file names and directory names in a specified path.

static
EnumerateFileSystemEntries(string, string) : IEnumerable<string>

Returns an enumerable collection of file names and directory names that match a search pattern in a specified path.

static
EnumerateFileSystemEntries(string, string, SearchOption) : IEnumerable<string>

Returns an enumerable collection of file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories.

static
Exists(string) : bool

Determines whether the given path refers to an existing directory on disk.

static
GetAccessControl(string) : System.Security.AccessControl.DirectorySecurity

Gets a System.Security.AccessControl.DirectorySecurity object that encapsulates the access control list (ACL) entries for a specified directory.

static
GetAccessControl(string, System.Security.AccessControl.AccessControlSections) : System.Security.AccessControl.DirectorySecurity

Gets a System.Security.AccessControl.DirectorySecurity object that encapsulates the specified type of access control list (ACL) entries for a specified directory.

static
GetCreationTime(string) : DateTime

Gets the creation date and time of a directory.

static
GetCreationTimeUtc(string) : DateTime

Gets the creation date and time, in Coordinated Universal Time (UTC) format, of a directory.

static
GetCurrentDirectory() : string

Gets the current working directory of the application.

static
GetDirectories(string) : string[]

Returns the names of subdirectories (including their paths) in the specified directory.

static
GetDirectories(string, string) : string[]

Returns the names of subdirectories (including their paths) that match the specified search pattern in the specified directory.

static
GetDirectories(string, string, SearchOption) : string[]

Returns the names of the subdirectories (including their paths) that match the specified search pattern in the specified directory, and optionally searches subdirectories.

static
GetDirectoryRoot(string) : string

Returns the volume information, root information, or both for the specified path.

static
GetFiles(string) : string[]

Returns the names of files (including their paths) in the specified directory.

static
GetFiles(string, string) : string[]

Returns the names of files (including their paths) that match the specified search pattern in the specified directory.

static
GetFiles(string, string, SearchOption) : string[]

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.

static
GetFileSystemEntries(string) : string[]

Returns the names of all files and subdirectories in a specified path.

static
GetFileSystemEntries(string, string) : string[]

Returns an array of file names and directory names that that match a search pattern in a specified path.

static
GetFileSystemEntries(string, string, SearchOption) : string[]

Returns an array of all the file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories.

static
GetLastAccessTime(string) : DateTime

Returns the date and time the specified file or directory was last accessed.

static
GetLastAccessTimeUtc(string) : DateTime

Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last accessed.

static
GetLastWriteTime(string) : DateTime

Returns the date and time the specified file or directory was last written to.

static
GetLastWriteTimeUtc(string) : DateTime

Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last written to.

static
GetLogicalDrives() : string[]

Retrieves the names of the logical drives on this computer in the form "<drive letter>:\".

static
GetParent(string) : DirectoryInfo

Retrieves the parent directory of the specified path, including both absolute and relative paths.

static
Move(string, string)

Moves a file or a directory and its contents to a new location.

static
SetAccessControl(string, System.Security.AccessControl.DirectorySecurity)

Applies access control list (ACL) entries described by a System.Security.AccessControl.DirectorySecurity object to the specified directory.

static
SetCreationTime(string, DateTime)

Sets the creation date and time for the specified file or directory.

static
SetCreationTimeUtc(string, DateTime)

Sets the creation date and time, in Coordinated Universal Time (UTC) format, for the specified file or directory.

static
SetCurrentDirectory(string)

Sets the application's current working directory to the specified directory.

static
SetLastAccessTime(string, DateTime)

Sets the date and time the specified file or directory was last accessed.

static
SetLastAccessTimeUtc(string, DateTime)

Sets the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last accessed.

static
SetLastWriteTime(string, DateTime)

Sets the date and time a directory was last written to.

static
SetLastWriteTimeUtc(string, DateTime)

Sets the date and time, in Coordinated Universal Time (UTC) format, that a directory was last written to.