Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


FileSystemAclExtensions.CreateDirectory(DirectorySecurity, String) Method

Definition

Creates a directory and returns it, ensuring it is created with the specified directory security. If the directory already exists, the existing directory is returned.

C#
public static System.IO.DirectoryInfo CreateDirectory(this System.Security.AccessControl.DirectorySecurity directorySecurity, string path);

Parameters

directorySecurity
DirectorySecurity

An object that determines the access control and audit security for the directory.

path
String

The path of the directory to create.

Returns

A directory information object representing either a created directory with the provided security properties, or the existing directory.

Exceptions

directorySecurity or path is null.

path is empty.

Could not find a part of the path.

Access to the path is denied.

Remarks

This extension method was added to .NET Core to bring the functionality that was provided by the System.IO.Directory.CreateDirectory(System.String,System.Security.AccessControl.DirectorySecurity) .NET Framework method.

Applies to

Termék Verziók
.NET 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided)
Windows Desktop 5