Creates all directories specified by path.
[Visual Basic] Public Shared Function CreateDirectories( _ ByVal path As String _ ) As Directory [C#] public static Directory CreateDirectories( string path ); [C++] public: static Directory* CreateDirectories( String* path ); [JScript] public static function CreateDirectories( path : String ) : Directory;
All directories specified by path.
Exception Type | Condition |
---|---|
ArgumentException | path is an empty string ("") or contains only whitespaces. |
ArgumentNullException | path is null. |
DirectoryNotFoundException | Part of the directory is not found. |
IOException | A file or directory already has the name specified by path. |
PathTooLongException | The specified path is too long. |
SecurityException | The caller does not have the required permission. |
The path parameter specifies a directory path, not a file path.
Unlike the CreateDirectory method, CreateDirectories will create as many directories as are required to guarantee that the specified path is valid. It is not an error if some or all of the specified directories exist.
Note Path names are limited to 248 characters.
NGWS Runtime Security:
FileIOPermissionAccess | Write flag required for write permission to the path. |
To create the directory "C:\Users\User1\Public\Html" when the current directory is "C:\Users\User1", use any of the following calls:
CreateDirectories("Public\\Html") CreateDirectories("\\Users\\User1\\Public\\Html") CreateDirectories("c:\\Users\\User1\\Public\\Html")
Note that an escape character is required by many languages toensure that the backslash is interpreted properly.
Directory Class | Directory Members | System.IO Namespace | CreateDirectory | CreateSubdirectories