CreateDirectory (kernel32)
Last changed: WithLithum-112.101.111.191

.
Summary

C# Signature:

[DllImport("kernel32.dll")]
static extern bool CreateDirectory(string lpPathName,
   IntPtr lpSecurityAttributes);

User-Defined Types:

None.

Notes:

This is a alternitive to the Directory.CreateDirectory() method provided by .NET

The advantage of using the DllImport is that the running assembly does not require access to the root of the directory structure.

Tips & Tricks:

Please add some!

Sample Code:

string path = "c:\\test\\mydir";
CreateDirectory(path, IntPtr.Zero);

Alternative Managed API:

[DllImport("msvcrt.dll", SetLastError=true)]
static extern int _mkdir(string path);

Documentation