User.IsAuthenticated Property

 

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

Namespace:   Microsoft.VisualBasic.ApplicationServices
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public bool IsAuthenticated { get; }

Property Value

Type: System.Boolean

True if the user was authenticated; otherwise, False.

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

System_CAPS_noteNote

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.

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

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

SecurityPermission

Describes a set of security permissions applied to code. Associated enumeration: ControlPrincipal.

.NET Framework
Available since 2.0
Return to top
Show: