Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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.

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.

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

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Show:
© 2015 Microsoft