NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Directory.CreateDirectory

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;

Parameters

path
The fully qualified path of the directory to create. The directory path can be absolute or relative. A relative path will be fully qualified based upon the current directory and drive.

Return Value

The new Directory object.

Exceptions

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.

Remarks

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.

Requirements

NGWS Runtime Security:

FileIOPermissionAccess Write flag required for write permission to the path.

See Also

Directory Class | Directory Members | System.IO Namespace | CreateDirectories | CreateSubdirectory