DirectorySecurity Klasa

Definicja

Reprezentuje zabezpieczenia kontroli dostępu i inspekcji dla katalogu. Klasa ta nie może być dziedziczona.

public ref class DirectorySecurity sealed : System::Security::AccessControl::FileSystemSecurity
public sealed class DirectorySecurity : System.Security.AccessControl.FileSystemSecurity
[System.Security.SecurityCritical]
public sealed class DirectorySecurity : System.Security.AccessControl.FileSystemSecurity
type DirectorySecurity = class
    inherit FileSystemSecurity
[<System.Security.SecurityCritical>]
type DirectorySecurity = class
    inherit FileSystemSecurity
Public NotInheritable Class DirectorySecurity
Inherits FileSystemSecurity
Dziedziczenie
Atrybuty

Przykłady

Poniższy przykład kodu używa klasy do dodania DirectorySecurity , a następnie usunięcia wpisu listy kontroli dostępu (ACL) z katalogu. Aby uruchomić ten przykład, musisz podać prawidłowe konto użytkownika lub grupy.

using namespace System;
using namespace System::IO;
using namespace System::Security::AccessControl;

// Adds an ACL entry on the specified directory for the
// specified account.
void AddDirectorySecurity(String^ directoryName, String^ account, 
     FileSystemRights rights, AccessControlType controlType)
{
    // Create a new DirectoryInfo object.
    DirectoryInfo^ dInfo = gcnew DirectoryInfo(directoryName);

    // Get a DirectorySecurity object that represents the
    // current security settings.
    DirectorySecurity^ dSecurity = dInfo->GetAccessControl();

    // Add the FileSystemAccessRule to the security settings.
    dSecurity->AddAccessRule( gcnew FileSystemAccessRule(account,
        rights, controlType));

    // Set the new access settings.
    dInfo->SetAccessControl(dSecurity);
}

// Removes an ACL entry on the specified directory for the
// specified account.
void RemoveDirectorySecurity(String^ directoryName, String^ account,
     FileSystemRights rights, AccessControlType controlType)
{
    // Create a new DirectoryInfo object.
    DirectoryInfo^ dInfo = gcnew DirectoryInfo(directoryName);

    // Get a DirectorySecurity object that represents the
    // current security settings.
    DirectorySecurity^ dSecurity = dInfo->GetAccessControl();

    // Add the FileSystemAccessRule to the security settings.
    dSecurity->RemoveAccessRule(gcnew FileSystemAccessRule(account,
        rights, controlType));

    // Set the new access settings.
    dInfo->SetAccessControl(dSecurity);
}    

int main()
{
    String^ directoryName = "TestDirectory";
    String^ accountName = "MYDOMAIN\\MyAccount";
    if (!Directory::Exists(directoryName))
    {
        Console::WriteLine("The directory {0} could not be found.", 
            directoryName);
        return 0;
    }
    try
    {
        Console::WriteLine("Adding access control entry for {0}",
            directoryName);

        // Add the access control entry to the directory.
        AddDirectorySecurity(directoryName, accountName,
            FileSystemRights::ReadData, AccessControlType::Allow);

        Console::WriteLine("Removing access control entry from {0}",
            directoryName);

        // Remove the access control entry from the directory.
        RemoveDirectorySecurity(directoryName, accountName, 
            FileSystemRights::ReadData, AccessControlType::Allow);

        Console::WriteLine("Done.");
    }
    catch (UnauthorizedAccessException^)
    {
        Console::WriteLine("You are not authorised to carry" +
            " out this procedure.");
    }
    catch (System::Security::Principal::
        IdentityNotMappedException^)
    {
        Console::WriteLine("The account {0} could not be found.", accountName);
    }
}
using System;
using System.IO;
using System.Security.AccessControl;

namespace FileSystemExample
{
    class DirectoryExample
    {
        public static void Main()
        {
            try
            {
                string DirectoryName = "TestDirectory";

                Console.WriteLine("Adding access control entry for " + DirectoryName);

                // Add the access control entry to the directory.
                AddDirectorySecurity(DirectoryName, @"MYDOMAIN\MyAccount", FileSystemRights.ReadData, AccessControlType.Allow);

                Console.WriteLine("Removing access control entry from " + DirectoryName);

                // Remove the access control entry from the directory.
                RemoveDirectorySecurity(DirectoryName, @"MYDOMAIN\MyAccount", FileSystemRights.ReadData, AccessControlType.Allow);

                Console.WriteLine("Done.");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.ReadLine();
        }

        // Adds an ACL entry on the specified directory for the specified account.
        public static void AddDirectorySecurity(string DirectoryName, string Account, FileSystemRights Rights, AccessControlType ControlType)
        {
            // Create a new DirectoryInfo object.
            DirectoryInfo dInfo = new DirectoryInfo(DirectoryName);

            // Get a DirectorySecurity object that represents the
            // current security settings.
            DirectorySecurity dSecurity = dInfo.GetAccessControl();

            // Add the FileSystemAccessRule to the security settings.
            dSecurity.AddAccessRule(new FileSystemAccessRule(Account,
                                                            Rights,
                                                            ControlType));

            // Set the new access settings.
            dInfo.SetAccessControl(dSecurity);
        }

        // Removes an ACL entry on the specified directory for the specified account.
        public static void RemoveDirectorySecurity(string DirectoryName, string Account, FileSystemRights Rights, AccessControlType ControlType)
        {
            // Create a new DirectoryInfo object.
            DirectoryInfo dInfo = new DirectoryInfo(DirectoryName);

            // Get a DirectorySecurity object that represents the
            // current security settings.
            DirectorySecurity dSecurity = dInfo.GetAccessControl();

            // Add the FileSystemAccessRule to the security settings.
            dSecurity.RemoveAccessRule(new FileSystemAccessRule(Account,
                                                            Rights,
                                                            ControlType));

            // Set the new access settings.
            dInfo.SetAccessControl(dSecurity);
        }
    }
}
Imports System.IO
Imports System.Security.AccessControl



Module DirectoryExample

    Sub Main()
        Try
            Dim DirectoryName As String = "TestDirectory"

            Console.WriteLine("Adding access control entry for " + DirectoryName)

            ' Add the access control entry to the directory.
            AddDirectorySecurity(DirectoryName, "MYDOMAIN\MyAccount", FileSystemRights.ReadData, AccessControlType.Allow)

            Console.WriteLine("Removing access control entry from " + DirectoryName)

            ' Remove the access control entry from the directory.
            RemoveDirectorySecurity(DirectoryName, "MYDOMAIN\MyAccount", FileSystemRights.ReadData, AccessControlType.Allow)

            Console.WriteLine("Done.")
        Catch e As Exception
            Console.WriteLine(e)
        End Try

        Console.ReadLine()

    End Sub


    ' Adds an ACL entry on the specified directory for the specified account.
    Sub AddDirectorySecurity(ByVal FileName As String, ByVal Account As String, ByVal Rights As FileSystemRights, ByVal ControlType As AccessControlType)
        ' Create a new DirectoryInfoobject.
        Dim dInfo As New DirectoryInfo(FileName)

        ' Get a DirectorySecurity object that represents the 
        ' current security settings.
        Dim dSecurity As DirectorySecurity = dInfo.GetAccessControl()

        ' Add the FileSystemAccessRule to the security settings. 
        dSecurity.AddAccessRule(New FileSystemAccessRule(Account, Rights, ControlType))

        ' Set the new access settings.
        dInfo.SetAccessControl(dSecurity)

    End Sub


    ' Removes an ACL entry on the specified directory for the specified account.
    Sub RemoveDirectorySecurity(ByVal FileName As String, ByVal Account As String, ByVal Rights As FileSystemRights, ByVal ControlType As AccessControlType)
        ' Create a new DirectoryInfo object.
        Dim dInfo As New DirectoryInfo(FileName)

        ' Get a DirectorySecurity object that represents the 
        ' current security settings.
        Dim dSecurity As DirectorySecurity = dInfo.GetAccessControl()

        ' Add the FileSystemAccessRule to the security settings. 
        dSecurity.RemoveAccessRule(New FileSystemAccessRule(Account, Rights, ControlType))

        ' Set the new access settings.
        dInfo.SetAccessControl(dSecurity)

    End Sub
End Module

Uwagi

Klasa DirectorySecurity określa prawa dostępu do katalogu systemowego i sposób przeprowadzania inspekcji prób dostępu. Ta klasa reprezentuje prawa dostępu i inspekcji jako zestaw reguł. Każda reguła dostępu jest reprezentowana przez FileSystemAccessRule obiekt, podczas gdy każda reguła inspekcji jest reprezentowana FileSystemAuditRule przez obiekt.

Klasa DirectorySecurity jest abstrakcją podstawowego systemu zabezpieczeń plików systemu Windows. W tym systemie każdy katalog ma uznaniową listę kontroli dostępu (DACL), która kontroluje dostęp do katalogu, oraz systemową listę kontroli dostępu (SACL), która określa próby kontroli dostępu, które są poddawane inspekcji. Klasy FileSystemAccessRule i FileSystemAuditRule to abstrakcje wpisów kontroli dostępu (ACL), które składają się na listy DACL i SACL.

Klasa DirectorySecurity ukrywa wiele szczegółów list DACL i SACL. Nie musisz martwić się o kolejność ACE lub null DACLS.

FileSecurity Użyj klasy , aby pobrać, dodać lub zmienić reguły dostępu reprezentujące listę DACL i SACL pliku.

W poniższych tabelach wymieniono metody, których można użyć do uzyskiwania dostępu do katalogu i utrzymania zabezpieczeń katalogu.

Zadanie Metody
Dodawanie reguł FileSystemSecurity.AddAccessRule

FileSystemSecurity.AddAuditRule
Usuwanie reguł FileSystemSecurity.RemoveAccessRule

FileSystemSecurity.RemoveAuditRule
Pobieranie kontroli dostępu do katalogu Directory.GetAccessControl

DirectoryInfo.GetAccessControl
Utrwalanie kontroli dostępu do katalogu Directory.SetAccessControl

DirectoryInfo.SetAccessControl

Konstruktory

DirectorySecurity()

Inicjuje nowe wystąpienie klasy DirectorySecurity.

DirectorySecurity(String, AccessControlSections)

Inicjuje nowe wystąpienie DirectorySecurity klasy z określonego katalogu przy użyciu określonych wartości wyliczenia AccessControlSections .

Właściwości

AccessRightType

Pobiera wyliczenie używane przez FileSystemSecurity klasę do reprezentowania praw dostępu.

(Odziedziczone po FileSystemSecurity)
AccessRulesModified

Pobiera lub ustawia wartość logiczną określającą, czy reguły dostępu skojarzone z tym ObjectSecurity obiektem zostały zmodyfikowane.

(Odziedziczone po ObjectSecurity)
AccessRuleType

Pobiera wyliczenie używane przez FileSystemSecurity klasę do reprezentowania reguł dostępu.

(Odziedziczone po FileSystemSecurity)
AreAccessRulesCanonical

Pobiera wartość logiczną określającą, czy reguły dostępu skojarzone z tym ObjectSecurity obiektem są w porządku kanonicznym.

(Odziedziczone po ObjectSecurity)
AreAccessRulesProtected

Pobiera wartość logiczną określającą, czy dyskrecja Access Control List (DACL) skojarzona z tym ObjectSecurity obiektem jest chroniona.

(Odziedziczone po ObjectSecurity)
AreAuditRulesCanonical

Pobiera wartość logiczną określającą, czy reguły inspekcji skojarzone z tym ObjectSecurity obiektem są w porządku kanonicznym.

(Odziedziczone po ObjectSecurity)
AreAuditRulesProtected

Pobiera wartość logiczną określającą, czy lista systemowa Access Control (SACL) skojarzona z tym ObjectSecurity obiektem jest chroniona.

(Odziedziczone po ObjectSecurity)
AuditRulesModified

Pobiera lub ustawia wartość logiczną określającą, czy reguły inspekcji skojarzone z tym ObjectSecurity obiektem zostały zmodyfikowane.

(Odziedziczone po ObjectSecurity)
AuditRuleType

Pobiera typ używany przez FileSystemSecurity klasę do reprezentowania reguł inspekcji.

(Odziedziczone po FileSystemSecurity)
GroupModified

Pobiera lub ustawia wartość logiczną określającą, czy grupa skojarzona z zabezpieczanym obiektem została zmodyfikowana.

(Odziedziczone po ObjectSecurity)
IsContainer

Pobiera wartość logiczną określającą, czy ten ObjectSecurity obiekt jest obiektem kontenera.

(Odziedziczone po ObjectSecurity)
IsDS

Pobiera wartość logiczną określającą, czy ten ObjectSecurity obiekt jest obiektem katalogu.

(Odziedziczone po ObjectSecurity)
OwnerModified

Pobiera lub ustawia wartość logiczną określającą, czy właściciel zabezpieczanego obiektu został zmodyfikowany.

(Odziedziczone po ObjectSecurity)
SecurityDescriptor

Pobiera deskryptor zabezpieczeń dla tego wystąpienia.

(Odziedziczone po ObjectSecurity)

Metody

AccessRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AccessControlType)

Inicjuje nowe wystąpienie FileSystemAccessRule klasy, która reprezentuje nową regułę kontroli dostępu dla określonego użytkownika, z określonymi prawami dostępu, kontrolą dostępu i flagami.

(Odziedziczone po FileSystemSecurity)
AddAccessRule(AccessRule)

Dodaje określoną regułę dostępu do listy Access Control dyskrecji skojarzonej z tym CommonObjectSecurity obiektem.

(Odziedziczone po CommonObjectSecurity)
AddAccessRule(FileSystemAccessRule)

Dodaje określone uprawnienie listy kontroli dostępu (ACL) do bieżącego pliku lub katalogu.

(Odziedziczone po FileSystemSecurity)
AddAuditRule(AuditRule)

Dodaje określoną regułę inspekcji do listy systemowej Access Control (SACL) skojarzonej z tym CommonObjectSecurity obiektem.

(Odziedziczone po CommonObjectSecurity)
AddAuditRule(FileSystemAuditRule)

Dodaje określoną regułę inspekcji do bieżącego pliku lub katalogu.

(Odziedziczone po FileSystemSecurity)
AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags)

Inicjuje FileSystemAuditRule nowe wystąpienie klasy reprezentujące określoną regułę inspekcji dla określonego użytkownika.

(Odziedziczone po FileSystemSecurity)
Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetAccessRules(Boolean, Boolean, Type)

Pobiera kolekcję reguł dostępu skojarzonych z określonym identyfikatorem zabezpieczeń.

(Odziedziczone po CommonObjectSecurity)
GetAuditRules(Boolean, Boolean, Type)

Pobiera kolekcję reguł inspekcji skojarzonych z określonym identyfikatorem zabezpieczeń.

(Odziedziczone po CommonObjectSecurity)
GetGroup(Type)

Pobiera grupę podstawową skojarzą z określonym właścicielem.

(Odziedziczone po ObjectSecurity)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetOwner(Type)

Pobiera właściciela skojarzonego z określoną grupą podstawową.

(Odziedziczone po ObjectSecurity)
GetSecurityDescriptorBinaryForm()

Zwraca tablicę wartości bajtów, która reprezentuje informacje deskryptora zabezpieczeń dla tego ObjectSecurity obiektu.

(Odziedziczone po ObjectSecurity)
GetSecurityDescriptorSddlForm(AccessControlSections)

Zwraca reprezentację języka SDDL (Security Descriptor Definition Language) określonego fragmentu deskryptora zabezpieczeń skojarzonego z tym ObjectSecurity obiektem.

(Odziedziczone po ObjectSecurity)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ModifyAccess(AccessControlModification, AccessRule, Boolean)

Stosuje określoną modyfikację do listy Access Control dyskrecjonalnych skojarzonych z tym CommonObjectSecurity obiektem.

(Odziedziczone po CommonObjectSecurity)
ModifyAccessRule(AccessControlModification, AccessRule, Boolean)

Stosuje określoną modyfikację do listy Access Control dyskrecjonalnych skojarzonych z tym ObjectSecurity obiektem.

(Odziedziczone po ObjectSecurity)
ModifyAudit(AccessControlModification, AuditRule, Boolean)

Stosuje określoną modyfikację do listy systemowej Access Control (SACL) skojarzonej z tym CommonObjectSecurity obiektem.

(Odziedziczone po CommonObjectSecurity)
ModifyAuditRule(AccessControlModification, AuditRule, Boolean)

Stosuje określoną modyfikację do listy systemowej Access Control (SACL) skojarzonej z tym ObjectSecurity obiektem.

(Odziedziczone po ObjectSecurity)
Persist(Boolean, String, AccessControlSections)

Zapisuje określone sekcje deskryptora zabezpieczeń skojarzonego z tym ObjectSecurity obiektem w magazynie trwałym. Zalecamy, aby wartości parametrów przekazanych includeSections do konstruktora i metody utrwalania są identyczne.

(Odziedziczone po ObjectSecurity)
Persist(SafeHandle, AccessControlSections)

Zapisuje określone sekcje deskryptora zabezpieczeń skojarzonego z tym NativeObjectSecurity obiektem w magazynie trwałym. Zalecamy.utrwalanie wartości parametrów przekazanych includeSections do konstruktora i utrwalania metod są identyczne.

(Odziedziczone po NativeObjectSecurity)
Persist(SafeHandle, AccessControlSections, Object)

Zapisuje określone sekcje deskryptora zabezpieczeń skojarzonego z tym NativeObjectSecurity obiektem w magazynie trwałym. Zalecamy, aby wartości parametrów przekazanych includeSections do konstruktora i metody utrwalania są identyczne.

(Odziedziczone po NativeObjectSecurity)
Persist(String, AccessControlSections)

Zapisuje określone sekcje deskryptora zabezpieczeń skojarzonego z tym NativeObjectSecurity obiektem w magazynie trwałym. Zalecamy, aby wartości parametrów przekazanych includeSections do konstruktora i metody utrwalania są identyczne.

(Odziedziczone po NativeObjectSecurity)
Persist(String, AccessControlSections, Object)

Zapisuje określone sekcje deskryptora zabezpieczeń skojarzonego z tym NativeObjectSecurity obiektem w magazynie trwałym. Zalecamy, aby wartości parametrów przekazanych includeSections do konstruktora i metody utrwalania są identyczne.

(Odziedziczone po NativeObjectSecurity)
PurgeAccessRules(IdentityReference)

Usuwa wszystkie reguły dostępu skojarzone z określonym IdentityReferenceelementem .

(Odziedziczone po ObjectSecurity)
PurgeAuditRules(IdentityReference)

Usuwa wszystkie reguły inspekcji skojarzone z określonym IdentityReferenceelementem .

(Odziedziczone po ObjectSecurity)
ReadLock()

Blokuje ten ObjectSecurity obiekt w celu uzyskania dostępu do odczytu.

(Odziedziczone po ObjectSecurity)
ReadUnlock()

Odblokuje ten ObjectSecurity obiekt w celu uzyskania dostępu do odczytu.

(Odziedziczone po ObjectSecurity)
RemoveAccessRule(AccessRule)

Usuwa reguły dostępu zawierające ten sam identyfikator zabezpieczeń i maskę dostępu co określona reguła dostępu z listy Access Control dyskrecjonalnych skojarzonych z tym CommonObjectSecurity obiektem.

(Odziedziczone po CommonObjectSecurity)
RemoveAccessRule(FileSystemAccessRule)

Usuwa wszystkie pasujące uprawnienia listy kontroli dostępu (ACL) lub zezwalają na nie z bieżącego pliku lub katalogu.

(Odziedziczone po FileSystemSecurity)
RemoveAccessRuleAll(AccessRule)

Usuwa wszystkie reguły dostępu, które mają ten sam identyfikator zabezpieczeń co określona reguła dostępu z listy dyskrecjonalnych Access Control (DACL) skojarzonych z tym CommonObjectSecurity obiektem.

(Odziedziczone po CommonObjectSecurity)
RemoveAccessRuleAll(FileSystemAccessRule)

Usuwa wszystkie uprawnienia listy kontroli dostępu dla określonego użytkownika z bieżącego pliku lub katalogu.

(Odziedziczone po FileSystemSecurity)
RemoveAccessRuleSpecific(AccessRule)

Usuwa wszystkie reguły dostępu, które dokładnie pasują do określonej reguły dostępu z listy dyskrecjonalnych Access Control (DACL) skojarzonych z tym CommonObjectSecurity obiektem.

(Odziedziczone po CommonObjectSecurity)
RemoveAccessRuleSpecific(FileSystemAccessRule)

Usuwa jedno pasujący uprawnienie listy kontroli dostępu (ACL) lub zezwala na nie z bieżącego pliku lub katalogu.

(Odziedziczone po FileSystemSecurity)
RemoveAuditRule(AuditRule)

Usuwa reguły inspekcji zawierające ten sam identyfikator zabezpieczeń i maskę dostępu co określona reguła inspekcji z listy system Access Control (SACL) skojarzonej z tym CommonObjectSecurity obiektem.

(Odziedziczone po CommonObjectSecurity)
RemoveAuditRule(FileSystemAuditRule)

Usuwa wszystkie pasujące reguły inspekcji lub zezwalają na nie z bieżącego pliku lub katalogu.

(Odziedziczone po FileSystemSecurity)
RemoveAuditRuleAll(AuditRule)

Usuwa wszystkie reguły inspekcji, które mają ten sam identyfikator zabezpieczeń co określona reguła inspekcji z listy System Access Control List (SACL) skojarzone z tym CommonObjectSecurity obiektem.

(Odziedziczone po CommonObjectSecurity)
RemoveAuditRuleAll(FileSystemAuditRule)

Usuwa wszystkie reguły inspekcji dla określonego użytkownika z bieżącego pliku lub katalogu.

(Odziedziczone po FileSystemSecurity)
RemoveAuditRuleSpecific(AuditRule)

Usuwa wszystkie reguły inspekcji, które dokładnie pasują do określonej reguły inspekcji z listy system Access Control (SACL) skojarzonej z tym CommonObjectSecurity obiektem.

(Odziedziczone po CommonObjectSecurity)
RemoveAuditRuleSpecific(FileSystemAuditRule)

Usuwa pojedynczą zgodną regułę inspekcji lub zezwala na nie z bieżącego pliku lub katalogu.

(Odziedziczone po FileSystemSecurity)
ResetAccessRule(AccessRule)

Usuwa wszystkie reguły dostępu w liście Access Control uznaniowej (DACL) skojarzonej z tym CommonObjectSecurity obiektem, a następnie dodaje określoną regułę dostępu.

(Odziedziczone po CommonObjectSecurity)
ResetAccessRule(FileSystemAccessRule)

Dodaje określone uprawnienie listy kontroli dostępu (ACL) do bieżącego pliku lub katalogu i usuwa wszystkie pasujące uprawnienia listy ACL.

(Odziedziczone po FileSystemSecurity)
SetAccessRule(AccessRule)

Usuwa wszystkie reguły dostępu, które zawierają ten sam identyfikator zabezpieczeń i kwalifikator co określona reguła dostępu w liście dyskrecjonalnych Access Control (DACL) skojarzonych z tym CommonObjectSecurity obiektem, a następnie dodaje określoną regułę dostępu.

(Odziedziczone po CommonObjectSecurity)
SetAccessRule(FileSystemAccessRule)

Ustawia określone uprawnienie listy kontroli dostępu (ACL) dla bieżącego pliku lub katalogu.

(Odziedziczone po FileSystemSecurity)
SetAccessRuleProtection(Boolean, Boolean)

Ustawia lub usuwa ochronę reguł dostępu skojarzonych z tym ObjectSecurity obiektem. Reguły dostępu chronionego nie mogą być modyfikowane przez obiekty nadrzędne za pomocą dziedziczenia.

(Odziedziczone po ObjectSecurity)
SetAuditRule(AuditRule)

Usuwa wszystkie reguły inspekcji zawierające ten sam identyfikator zabezpieczeń i kwalifikator co określona reguła inspekcji w liście system Access Control (SACL) skojarzonej z tym CommonObjectSecurity obiektem, a następnie dodaje określoną regułę inspekcji.

(Odziedziczone po CommonObjectSecurity)
SetAuditRule(FileSystemAuditRule)

Ustawia określoną regułę inspekcji dla bieżącego pliku lub katalogu.

(Odziedziczone po FileSystemSecurity)
SetAuditRuleProtection(Boolean, Boolean)

Ustawia lub usuwa ochronę reguł inspekcji skojarzonych z tym ObjectSecurity obiektem. Chronione reguły inspekcji nie mogą być modyfikowane przez obiekty nadrzędne za pomocą dziedziczenia.

(Odziedziczone po ObjectSecurity)
SetGroup(IdentityReference)

Ustawia grupę podstawową deskryptora zabezpieczeń skojarzonego z tym ObjectSecurity obiektem.

(Odziedziczone po ObjectSecurity)
SetOwner(IdentityReference)

Ustawia właściciela deskryptora zabezpieczeń skojarzonego z tym ObjectSecurity obiektem.

(Odziedziczone po ObjectSecurity)
SetSecurityDescriptorBinaryForm(Byte[])

Ustawia deskryptor zabezpieczeń dla tego ObjectSecurity obiektu z określonej tablicy wartości bajtów.

(Odziedziczone po ObjectSecurity)
SetSecurityDescriptorBinaryForm(Byte[], AccessControlSections)

Ustawia określone sekcje deskryptora zabezpieczeń dla tego ObjectSecurity obiektu z określonej tablicy wartości bajtów.

(Odziedziczone po ObjectSecurity)
SetSecurityDescriptorSddlForm(String)

Ustawia deskryptor zabezpieczeń dla tego ObjectSecurity obiektu z określonego ciągu Języka definicji deskryptora zabezpieczeń (SDDL).

(Odziedziczone po ObjectSecurity)
SetSecurityDescriptorSddlForm(String, AccessControlSections)

Ustawia określone sekcje deskryptora zabezpieczeń dla tego ObjectSecurity obiektu z określonego ciągu Języka definicji deskryptora zabezpieczeń (SDDL).

(Odziedziczone po ObjectSecurity)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)
WriteLock()

Blokuje ten ObjectSecurity obiekt w celu uzyskania dostępu do zapisu.

(Odziedziczone po ObjectSecurity)
WriteUnlock()

Odblokowuje ten ObjectSecurity obiekt w celu uzyskania dostępu do zapisu.

(Odziedziczone po ObjectSecurity)

Metody rozszerzania

CreateDirectory(DirectorySecurity, String)

Tworzy katalog i zwraca go, upewniając się, że jest tworzony z określonymi zabezpieczeniami katalogu. Jeśli katalog już istnieje, zostanie zwrócony istniejący katalog.

Dotyczy