Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Directory Class

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

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
<ComVisibleAttribute(True)> _
Public NotInheritable Class Directory

The Directory type exposes the following members.

  NameDescription
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360CreateDirectoryWhen it is called by trusted applications, creates all directories and subdirectories as specified by path.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360Delete(String)When it is called by trusted applications, deletes an empty directory from a specified path.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360Delete(String, Boolean)When it is called by trusted applications, deletes the specified directory and, if indicated, any subdirectories and files in the directory.
Public methodStatic memberEnumerateDirectories(String)When it is called by trusted applications, returns an enumerable collection of directory names in a specified path.
Public methodStatic memberEnumerateDirectories(String, String)When it is called by trusted applications, returns an enumerable collection of directory names that match a search pattern in a specified path.
Public methodStatic memberEnumerateDirectories(String, String, SearchOption)When it is called by trusted applications, returns an enumerable collection of directory names that match a search pattern in a specified path, and optionally searches subdirectories.
Public methodStatic memberEnumerateFiles(String)When it is called by trusted applications, returns an enumerable collection of file names in a specified path.
Public methodStatic memberEnumerateFiles(String, String)When it is called by trusted applications, returns an enumerable collection of file names that match a search pattern in a specified path.
Public methodStatic memberEnumerateFiles(String, String, SearchOption)When it is called by trusted applications, returns an enumerable collection of file names that match a search pattern in a specified path, and optionally searches subdirectories.
Public methodStatic memberEnumerateFileSystemEntries(String)When it is called by trusted applications, returns an enumerable collection of file-system entries in a specified path.
Public methodStatic memberEnumerateFileSystemEntries(String, String)When it is called by trusted applications, returns an enumerable collection of file-system entries that match a search pattern in a specified path.
Public methodStatic memberEnumerateFileSystemEntries(String, String, SearchOption)When it is called by trusted applications, returns an enumerable collection of file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360ExistsWhen it is called by trusted applications, determines whether the given path refers to an existing directory on disk.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetCreationTimeWhen it is called by trusted applications, gets the creation date and time of a directory.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetCurrentDirectoryWhen it is called by trusted applications, gets the current working directory of the application.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetDirectories(String)Security Critical. Gets the names of subdirectories (including their paths) in the specified directory.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetDirectories(String, String)Security Critical. Gets an array of directories (including their paths) that match the specified search pattern in the current directory.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetDirectoryRootWhen it is called by trusted applications, returns the volume information, root information, or both for the specified path.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetFiles(String)Security Critical. Returns the names of files in the specified directory.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetFiles(String, String)Security Critical. Returns the names of files in the specified directory that match the specified search pattern.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetFileSystemEntries(String)Security Critical. Returns the names of all files and subdirectories in the specified directory.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetFileSystemEntries(String, String)Security Critical. Returns an array of file system entries matching the specified search criteria.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetLastAccessTimeWhen it is called by trusted applications, returns the date and time the specified file or directory was last accessed.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360GetLastWriteTimeWhen it is called by trusted applications, returns the date and time the specified file or directory was last written to.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360MoveWhen it is called by trusted applications, moves a file or a directory and its contents to a new location.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360SetCurrentDirectorySecurity Critical. Sets the application's current working directory to the specified directory.
Top

Platform Notes

Silverlight for Windows Phone Silverlight for Windows Phone

This type is present to support the .NET Compact Framework infrastructure in Silverlight for Windows Phone, and it is not intended to be used in your application code.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

Show:
© 2014 Microsoft