Name
Directory.Exists Method
Class
System.IO.Directory
Syntax
Directory.Exists(path)-
path Use: Required
Data Type: String
The path of the directory whose existence is to be determined
Return Value
True if the specified path exists;
False otherwise
Description
Determines whether a given directory exists
Rules at a Glance
pathcan be either an absolute path (a complete path from the root directory to the directory whose existence is to be confirmed) or a relative path (starting from the current directory to the path whose existence is to be confirmed).pathcan be either a path on the local system, the path of a mapped network drive, or a UNC path.pathcannot contain wildcard characters.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access