Dns.GetHostName() : Dns « System.Net « VB.Net by API






Dns.GetHostName()

  




Imports System.Environment
Imports System.Net
  
Public Class Tester
    Public Shared Sub Main
        Dim hostname As String = Dns.GetHostName()
        Dim ipaddress As String = CType(Dns.GetHostByName(hostname).AddressList.GetValue(0), IPAddress).ToString
        Console.WriteLine("Computer Name: " & hostname & "   IP Address: " & ipaddress)
    End Sub

End Class  

   
    
  








Related examples in the same category

1.Dns.BeginResolve
2.Dns.GetHostByAddress
3.Dns.GetHostByName
4.Dns.Resolve