WindowsIdentity.IsAnonymous Eigenschaft

Definition

Ruft einen Wert ab, der angibt, ob das Benutzerkonto vom System als anonymes Konto identifiziert wird.

public:
 virtual property bool IsAnonymous { bool get(); };
public virtual bool IsAnonymous { get; }
member this.IsAnonymous : bool
Public Overridable ReadOnly Property IsAnonymous As Boolean

Eigenschaftswert

true, wenn das Benutzerkonto ein anonymes Konto ist, andernfalls false.

Beispiele

Der folgende Code zeigt die Verwendung der IsAnonymous -Eigenschaft, um zu erkennen, ob das Benutzerkonto vom System als anonymes Konto identifiziert wird. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die WindowsIdentity-Klasse bereitgestellt wird.

if (  !windowsIdentity->IsAnonymous )
{
   propertyDescription = String::Concat( propertyDescription, ", is not an Anonymous account" );
}
if (!windowsIdentity.IsAnonymous)
{
    propertyDescription += " is not an Anonymous account";
}
If Not windowsIdentity.IsAnonymous Then
    propertyDescription += " is not an Anonymous account"
End If

Hinweise

Die IsAnonymous -Eigenschaft erkennt sowohl die anonyme Windows-Identität als auch die anonyme Identität, die von der GetAnonymous -Methode zurückgegeben wird.

Anonyme Konten werden in der Regel nur aus ASP.NET-basierten Anwendungen gefunden, wenn der anonyme Zugriff durch Internetinformationsdienste (IIS) zulässig ist.

Gilt für: