WindowsIdentity.Groups Özellik

Tanım

geçerli Windows kullanıcının ait olduğu grupları alır.

public:
 property System::Security::Principal::IdentityReferenceCollection ^ Groups { System::Security::Principal::IdentityReferenceCollection ^ get(); };
public System.Security.Principal.IdentityReferenceCollection Groups { get; }
public System.Security.Principal.IdentityReferenceCollection? Groups { get; }
member this.Groups : System.Security.Principal.IdentityReferenceCollection
Public ReadOnly Property Groups As IdentityReferenceCollection

Özellik Değeri

IdentityReferenceCollection

geçerli Windows kullanıcının ait olduğu grupları temsil eden nesne.

Örnekler

Aşağıdaki kod örneği, Groups geçerli kullanıcının ait olduğu gruplar için kimlik başvurularını göstermek üzere özelliğinin kullanımını gösterir. Bu kod örneği, sınıfı için sağlanmış daha büyük bir örneğin bir parçasıdır WindowsIdentity .

// Display the SIDs for the groups the current user belongs to.
Console.WriteLine("Display the SIDs for the groups the current user belongs to.");
IdentityReferenceCollection irc = windowsIdentity.Groups;
foreach (IdentityReference ir in irc)
    Console.WriteLine(ir.Value);
' Display the SIDs for the groups the current user belongs to.
Console.WriteLine("Display the SIDs for the groups the current user belongs to.")
Dim irc As IdentityReferenceCollection
Dim ir As IdentityReference
irc = windowsIdentity.Groups
For Each ir In irc
    Console.WriteLine(ir.Value)
Next

Şunlara uygulanır