This single line of VB.NET code below will put the name of the current Windows user into the currentUserName variable:
Dim currentUserName As String = My.User.Name
This single line of VB.NET code below will put the name of the current Windows user into the currentUserName variable:
Dim currentUserName As String = My.User.Name