AuthenticateEventArgs AuthenticateEventArgs AuthenticateEventArgs AuthenticateEventArgs Class

定義

Authenticate イベントのデータを提供します。Provides data for the Authenticate event.

public ref class AuthenticateEventArgs : EventArgs
public class AuthenticateEventArgs : EventArgs
type AuthenticateEventArgs = class
    inherit EventArgs
Public Class AuthenticateEventArgs
Inherits EventArgs
継承
AuthenticateEventArgsAuthenticateEventArgsAuthenticateEventArgsAuthenticateEventArgs

次のコード例では、AuthenticateEventArgsカスタム認証方法にデータを渡すクラス。The following code example uses the AuthenticateEventArgs class to pass data to a custom authentication method.

<%@ 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>

注釈

AuthenticateEventArgsクラスに必要なデータを提供、Authenticateイベント。The AuthenticateEventArgs class provides the data needed for the Authenticate event. Web サイト用のカスタム認証スキーム、Authenticatedプロパティをユーザーのログインの試行が成功したかどうかを示します。Custom authentication schemes for a Web site use the Authenticated property to indicate whether a user's login attempt succeeded.

コンストラクター

AuthenticateEventArgs() AuthenticateEventArgs() AuthenticateEventArgs() AuthenticateEventArgs()

AuthenticateEventArgs プロパティを false に設定して、Authenticated クラスの新しいインスタンスを初期化します。Initializes a new instance of the AuthenticateEventArgs class with the Authenticated property set to false.

AuthenticateEventArgs(Boolean) AuthenticateEventArgs(Boolean) AuthenticateEventArgs(Boolean) AuthenticateEventArgs(Boolean)

AuthenticateEventArgs クラスの新しいインスタンスを初期化します。Initializes a new instance of the AuthenticateEventArgs class.

プロパティ

Authenticated Authenticated Authenticated Authenticated

ユーザーの認証が成功したかどうかを示す値を取得または設定します。Gets or sets a value indicating whether a user's authentication attempt succeeded.

メソッド

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指定したオブジェクトが、現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

既定のハッシュ関数として機能します。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

現在のインスタンスの Type を取得します。Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object.

(Inherited from Object)

適用対象

こちらもご覧ください