FileSystemAclExtensions.CreateDirectory(DirectorySecurity, String) Method
Definition
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 directory and returns it, ensuring it is created with the specified directory security. If the directory already exists, the existing directory is returned.
public:
[System::Runtime::CompilerServices::Extension]
static System::IO::DirectoryInfo ^ CreateDirectory(System::Security::AccessControl::DirectorySecurity ^ directorySecurity, System::String ^ path);
public static System.IO.DirectoryInfo CreateDirectory (this System.Security.AccessControl.DirectorySecurity directorySecurity, string path);
static member CreateDirectory : System.Security.AccessControl.DirectorySecurity * string -> System.IO.DirectoryInfo
<Extension()>
Public Function CreateDirectory (directorySecurity As DirectorySecurity, path As String) As DirectoryInfo
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
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기