Visual Basic Finding the Operating System Username

In Visual Basic, the UserName property of the Environment class is used to find the active user name in the current operating system.

An example is given below..

Module ModuleTest Sub Main() Dim uName As String = System.Environment.UserName Console.WriteLine(uName) Console.ReadLine() End Sub End Module


You May Interest

Visual Basic Substring Method

Visual Basic Generating Random Letters

Visual Basic How To Find The Average Of 10 Numbers Using A While ...

Visual Basic Finding the Computer Name

Visual Basic Powering a Number