Below is a sample code snippet that demonstrates how to get the current computer name using VB.NET?
How to Get the Computer Name using VB.NET?
Module AC
Sub Main()
Dim ComputerName As String
ComputerName = GetCurrentComputerName()
Console.WriteLine(ComputerName)
Console.ReadLine()
End Sub
Function GetCurrentComputerName() As String
Return My.Computer.Name.ToString()
End Function
End Module
Leave a Reply