Dns.GetHostName gets the host name of the local computer.
Imports System.IO
Imports System.Net
Imports System.Text
Public Class MainClass
Shared Sub Main()
Try
Dim hostName As [String] = Dns.GetHostName()
Console.WriteLine(("Computer name :" + hostName))
Catch e As Exception
Console.WriteLine("Exception caught!!!")
Console.WriteLine(("Source : " + e.Source))
Console.WriteLine(("Message : " + e.Message))
End Try
End Sub
End Class