Creates the directory as specified by path.
[Visual Basic] Public Shared Function CreateDirectory( _ ByVal path As String _ ) As Directory [C#] public static Directory CreateDirectory( string path ); [C++] public: static Directory* CreateDirectory( String* path ); [JScript] public static function CreateDirectory( path : String ) : Directory;
The new Directory object.
Exception Type | Condition |
---|---|
ArgumentException | path specifies an invalid file path. |
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 fully qualified path of the directory to be created is specified by path. Except for the last element, path must designate an existing directory. The last element in path
specifies the name of the new directory to create. An error occurs if a file or directory of that name already exists.
Note Path names are limited to 248 characters.
NGWS Runtime Security:
FileIOPermissionAccess | Write flag required for write permission to the path. |
Directory Class | Directory Members | System.IO Namespace | CreateDirectories | CreateSubdirectory