Partager via


WebRequestInformation.Principal Propriété

Définition

Obtient l'instance de l'instance principale de code managé associée à la demande Web.

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

Valeur de propriété

IPrincipal

L'instance IPrincipal associée à l'événement de demande.

Exemples

L’exemple de code suivant montre comment utiliser le principal associé à la requête Web.

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

Remarques

Le principal fait référence à l’entité authentifiée qui a émis la demande Web.

S’applique à