Visual Basic Finding the Computer Name

In Visual Basic, the MachineName property of the Environment class is used to find the name of the computer on which the program is running.

Below is a sample code on how to use it.

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


You May Interest

Visual Basic Finding the Operating System Username

Visual Basic Randomly Shuffle a List

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

Visual Basic Powering a Number

How to Find the Name of the Operating System in Visual Basic ?