Get IP address

GetIP address with VB.net

Module Module1

Sub Main()
Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName)
Console.WriteLine(CType(h.AddressList.GetValue(0), Net.IPAddress).ToString)
End Sub

End Module

Related posts:

  1. list serial ports Module Module1 Sub Main() For Each portName As String In...
  2. Is network available Module Module1 Sub Main() Dim isAvailable As Boolean isAvailable =...
  3. Degrees to radians conversion Module Module1 Public Function DegreesToRadians(ByVal degrees As Double) As Double...
  4. Get the screen size Module Module1 Sub Main() Dim height As Integer = My.Computer.Screen.Bounds.Height...
  5. Ping an IP address My.Computer.Network.Ping(targetSystem[, timeout]) targetSystem is a string IP address, a host...

Related posts brought to you by Yet Another Related Posts Plugin.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>