UserValidatedEventArgs UserValidatedEventArgs UserValidatedEventArgs UserValidatedEventArgs Class

定義

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

public ref class UserValidatedEventArgs : EventArgs
public class UserValidatedEventArgs : EventArgs
type UserValidatedEventArgs = class
    inherit EventArgs
Public Class UserValidatedEventArgs
Inherits EventArgs
継承
UserValidatedEventArgsUserValidatedEventArgsUserValidatedEventArgsUserValidatedEventArgs

次のコード例では、このクラスを使用して、フォームのタイトル バーでユーザー名を表示する方法を示します。The following example code demonstrates how to use this class to display the user name in the title bar of a form.

private ClientFormsAuthenticationMembershipProvider formsMembershipProvider =
    (ClientFormsAuthenticationMembershipProvider)
    System.Web.Security.Membership.Provider;
private String appName = "ClientAppServicesDemo";

private void AttachUserValidatedEventHandler()
{
    formsMembershipProvider.UserValidated += 
        new EventHandler<UserValidatedEventArgs>(Form1_UserValidated);
}

private void Form1_UserValidated(object sender, UserValidatedEventArgs e)
{
    // Set the form's title bar to the application name and the user name.
    this.Text = String.Format("{0} ({1})", appName, e.UserName);
}
Private WithEvents formsMembershipProvider As  _
    ClientFormsAuthenticationMembershipProvider = _
    System.Web.Security.Membership.Provider

Private appName As String = "ClientAppServicesDemo"

Private Sub Form1_UserValidated(ByVal sender As Object, _
    ByVal e As UserValidatedEventArgs) _
    Handles formsMembershipProvider.UserValidated

    ' Set the form's title bar to the application name and the user name.
    Me.Text = String.Format("{0} ({1})", appName, e.UserName)

End Sub

注釈

このクラスで検証済みのユーザーのユーザー名へのアクセスを提供する、UserNameプロパティ。This class provides access to the user name of the validated user through the UserName property.

イベントを処理する方法の詳細については、次を参照してください。処理とイベントの発生します。For more information about how to handle events, see Handling and Raising Events.

コンストラクター

UserValidatedEventArgs(String) UserValidatedEventArgs(String) UserValidatedEventArgs(String) UserValidatedEventArgs(String)

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

プロパティ

UserName UserName UserName UserName

検証済みユーザーのユーザー名を取得します。Gets the user name of the validated user.

メソッド

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)

適用対象

こちらもご覧ください