WindowsIdentity.Groups Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
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
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