User.IsAuthenticated Property

Definition

Gets a value that indicates whether the user has been authenticated.

public:
 property bool IsAuthenticated { bool get(); };
public bool IsAuthenticated { get; }
member this.IsAuthenticated : bool
Public ReadOnly Property IsAuthenticated As Boolean

Property Value

True if the user was authenticated; otherwise, False.

Examples

This example verifies that the user has been authenticated before accessing a resource.

If My.User.IsAuthenticated Then
    ' Insert code to access a resource here.
End If

Remarks

The My.User.IsAuthenticated property allows your code to determine if the current user has been authenticated.

Note

The exact behavior of My.User object depends on the type of the application and on the operating system on which the application runs. For more information, see the User class overview.

Availability by Project Type

Project type Available
Windows Application Yes
Class Library Yes
Console Application Yes
Windows Control Library Yes
Web Control Library Yes
Windows Service Yes
Web Site Yes

Applies to

See also