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