AuthenticateEventArgs Classe
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Fornisce i dati per l'evento Authenticate.
public ref class AuthenticateEventArgs : EventArgs
public class AuthenticateEventArgs : EventArgs
type AuthenticateEventArgs = class
inherit EventArgs
Public Class AuthenticateEventArgs
Inherits EventArgs
- Ereditarietà
Nell'esempio di codice seguente viene utilizzata la AuthenticateEventArgs classe per passare dati a un metodo di autenticazione personalizzato.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
private bool SiteSpecificAuthenticationMethod(string UserName, string Password)
{
// Insert code that implements a site-specific custom
// authentication method here.
//
// This example implementation always returns false.
return false;
}
private void OnAuthenticate(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
Authenticated = SiteSpecificAuthenticationMethod(Login1.UserName, Login1.Password);
e.Authenticated = Authenticated;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Login id="Login1" runat="server"
OnAuthenticate="OnAuthenticate">
</asp:Login>
</form>
</body>
</html>
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Function SiteSpecificAuthenticationMethod(ByVal UserName As String, ByVal Password As String) As Boolean
' Insert code that implements a site-specific custom
' authentication method here.
'
' This example implementation always returns false.
Return False
End Function
Sub OnAuthenticate(ByVal sender As Object, ByVal e As AuthenticateEventArgs)
Dim Authenticated As Boolean
Authenticated = SiteSpecificAuthenticationMethod(Login1.UserName, Login1.Password)
e.Authenticated = Authenticated
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Login id="Login1" runat="server"
OnAuthenticate="OnAuthenticate">
</asp:Login>
</form>
</body>
</html>
La AuthenticateEventArgs classe fornisce i dati necessari per l'evento Authenticate . Gli schemi di autenticazione personalizzati per un sito Web usano la Authenticated proprietà per indicare se il tentativo di accesso di un utente è riuscito.
Authenticate |
Consente di inizializzare una nuova istanza della classe AuthenticateEventArgs con la proprietà Authenticated impostata su |
Authenticate |
Inizializza una nuova istanza della classe AuthenticateEventArgs. |
Authenticated |
Ottiene o imposta un valore che indica se il tentativo di autenticazione di un utente ha avuto esito positivo. |
Equals(Object) |
Determina se l'oggetto specificato è uguale all'oggetto corrente. (Ereditato da Object) |
Get |
Funge da funzione hash predefinita. (Ereditato da Object) |
Get |
Ottiene l'oggetto Type dell'istanza corrente. (Ereditato da Object) |
Memberwise |
Crea una copia superficiale dell'oggetto Object corrente. (Ereditato da Object) |
To |
Restituisce una stringa che rappresenta l'oggetto corrente. (Ereditato da Object) |
Prodotto | Versioni |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: