DirectoryCreateDirectory Method (String, DirectorySecurity) |
Creates all the directories in the specified path, unless the already exist, applying the specified Windows security.
Namespace: Alphaleonis.Win32.FilesystemAssembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax public static DirectoryInfo CreateDirectory(
string path,
DirectorySecurity directorySecurity
)
Public Shared Function CreateDirectory (
path As String,
directorySecurity As DirectorySecurity
) As DirectoryInfo
public:
static DirectoryInfo^ CreateDirectory(
String^ path,
DirectorySecurity^ directorySecurity
)
static member CreateDirectory :
path : string *
directorySecurity : DirectorySecurity -> DirectoryInfo
Parameters
- path
- Type: SystemString
The directory to create. - directorySecurity
- Type: System.Security.AccessControlDirectorySecurity
The access control to apply to the directory.
Return Value
Type:
DirectoryInfoAn object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
Exceptions Remarks MSDN: .NET 4+ Trailing spaces are removed from the end of the path parameter before creating the directory.
See Also