WebRequestInformation.Principal Eigenschap

Definitie

Hiermee haalt u het exemplaar op van de principal voor beheerde code die is gekoppeld aan de webaanvraag.

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

Waarde van eigenschap

Het IPrincipal exemplaar dat is gekoppeld aan de aanvraag gebeurtenis.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u de principal gebruikt die is gekoppeld aan de webaanvraag.

// Get the request principal.
public string GetRequestPrincipal()
{
    // Get the request principal.
    return (string.Format(
        "Request principal name: {0}",
        RequestInformation.Principal.Identity.Name));
}
' Get the request principal.
Public Function GetRequestPrincipal() As String
   ' Get the request principal.
     Return String.Format( _
     "Request principal name: {0}", _
     RequestInformation.Principal.Identity.Name)
End Function 'GetRequestPrincipal

Opmerkingen

De principal verwijst naar de geverifieerde entiteit die de webaanvraag heeft uitgegeven.

Van toepassing op