Get My IP Address

  • Thread starter Thread starter Eddie
  • Start date Start date
This is one of the posibilities

Dim myIpadres As System.Net.IPAddress
Dim strhost As String
Dim myWorkstation As String = System.Net.Dns.GetHostName()
Dim IPAdres As String =
System.Net.Dns.Resolve(myWorkstation).AddressList(0).ToString
Me.TextBox1.Text = myWorkstation & "=" & IPAdres & vbCrLf

Cor
 
* "Eddie said:
How may I get my IP Address with vb.net ?

\\\
Dim ip As Net.IPAddress
For Each ip In _
System.Net.Dns.Resolve( _
SystemInformation.ComputerName _
).AddressList
Console.WriteLine(ip.ToString())
Next ip
///

- or -

\\\
Dim strIpAddress as String = _
Dns.GetHostByName(Dns.GetHostName).AddressList(0).ToString()
///
 
Back
Top