CreateDirectory Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Creates all directories and subdirectories in the specified path.
Namespace: System.IO
Assembly: System.IO (in System.IO.dll)
Syntax
'Declaration
Public Shared Function CreateDirectory ( _
path As String _
) As DirectoryInfo
public static DirectoryInfo CreateDirectory(
string path
)
public:
static DirectoryInfo^ CreateDirectory(
String^ path
)
static member CreateDirectory :
path:string -> DirectoryInfo
public static function CreateDirectory(
path : String
) : DirectoryInfo
Parameters
- path
Type: System. . :: . .String
The directory path to create.
Return Value
Type: System.IO. . :: . .DirectoryInfo
An object that represents the directory for the specified path.
Remarks
Any and all directories specified in path are created, unless they already exist or unless some part of path is invalid. The path parameter specifies a directory path, not a file path. If the directory already exists, this method does not create a new directory, but it returns a DirectoryInfo object for the existing directory.
Trailing spaces are removed from the end of the path parameter before creating the directory.
Creating a directory with only the colon character (:) is not supported, and will cause a NotSupportedException to be thrown.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.