Question : vb.net - get ip address from host

hello there,
how can I make a textbox show the ip address from a host name like ("experts-exchange.com")

Answer : vb.net - get ip address from host

You just need to replace localhostname with "experts-exchange.com" in comment that i put here:
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_24955175.html

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Imports System.Net 
 
 

    Private Sub IPAddress()
        'To get local address
        Dim LocalHostName As String
        Dim i As Integer
        LocalHostName = Dns.GetHostName()
        Dim IpAdd() As IPAddress = Dns.GetHostAddresses("experts-exchange.com")
        For i = 0 To IpAdd.GetUpperBound(0)
            If IpAdd(i).AddressFamily = Sockets.AddressFamily.InterNetwork Then
                Me.Text = Me.Text + " " + IpAdd(i).ToString()
            End If
        Next
    End Sub
Random Solutions  
 
programming4us programming4us