Get the username of the currently logged in user

If you want to get the username for the currently logged in user you can use the following code;

Public Shared ReadOnly Property Username() As String
    Get
        Return System.Environment.UserName
    End Get
End Property

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.