FileSystem.MkDir(String) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new directory. The My
feature gives you better productivity and performance in file I/O operations than MkDir
. For more information, see CreateDirectory(String).
public:
static void MkDir(System::String ^ Path);
public static void MkDir(string Path);
static member MkDir : string -> unit
Public Sub MkDir (Path As String)
- Path
- String
Required. A string expression that identifies the directory to be created. The Path
may include the drive. If no drive is specified, MkDir
creates the new directory on the current drive.
Path
is not specified or is empty.
Permission denied.
Directory already exists.
This example uses the MkDir
function to create a directory. If the drive is not specified, the new directory is created on the current drive.
' Make new directory.
MkDir("C:\TESTDIR")
This function creates a new directory.
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: