Share via


WindowsIdentity.Groups Özellik

Tanım

Geçerli Windows kullanıcısı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

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

Örnekler

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

// 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