MembershipUser::LastLoginDate Property

 

Gets or sets the date and time when the user was last authenticated.

Namespace:   System.Web.Security
Assembly:  System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)

public:
property DateTime LastLoginDate {
	virtual DateTime get();
	virtual void set(DateTime value);
}

Property Value

Type: System::DateTime

The date and time when the user was last authenticated.

For new users, the LastLoginDate is equal to the CreationDate if the user has not yet logged on. The LastLoginDate is updated to the current date and time if a call to the ValidateUser method is successful.

You can also modify the last login date by setting the LastLoginDate property of a MembershipUser and passing the modified MembershipUser object to the UpdateUser method.

The SqlMembershipProvider sets the CreationDate, LastLoginDate, LastActivityDate, and LastPasswordChangedDate date to the same date and time when a membership user is created by the CreateUser method.

The following code example displays all membership user names in a ListBox control and uses labels to show specific membership information for the selected user name, including the LastLoginDate property value for the membership user.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: