README.md

December 5, 2022 ยท View on GitHub

Return your local ip address

Description

Simple example on how to retrieve your local machines IP Address in VB.Net using the Frameworks Sockets.

More Info

Returns your IP Address!

Submitted On
ByBrian S. Smith
LevelBeginner
User Rating4.3 (13 globes from 3 users)
CompatibilityVB.NET
CategoryInternet/ Browsers/ HTML
World.Net (C#, VB.net)
Archive File

Source Code

'Be sure to import these into your Class/Struct
Imports System.Net
Imports System.Net.Sockets
'Simple 2 lines and you have your IP address.
Dim objIPAddress As New IPAddress(Dns.GetHostByName(Dns.GetHostName).AddressList(0).Address)
Dim strIPAddress As String = objIPAddress.ToString