Get the User name in Visual Basic.Net PDF Print E-mail
Written by J. Bijvoets   
Tuesday, 23 November 2010 20:27

How to get the User Name in Visual Basic 2010

An fine usage of the My-object in Visual Basic.Net is the User.Name-property. You can easily determine the current username by the following code:

Dim MyUsername as string = My.User.Name

Don't forget to examine the other objects of the My-Keyword: it can save you lots of troubles!