Is there a way using VB.NET to detect the IP address of the computer the app is running on so that I can avoid prompting a user or hardcoding the IP address into the app?
Thanks,
Eric
Is there a way using VB.NET to detect the IP address of the computer the app is running on so that I can avoid prompting a user or hardcoding the IP address into the app?
Thanks,
Eric
This will get the local ip address of the machine.
VB Code:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim dns As System.Net.Dns Me.Text = dns.Resolve(SystemInformation.ComputerName).AddressList(0).ToString() End Sub
Thank you!
That works.
I appreciate your help.
Eric
Just so you know that it gets the LOCAL ip... I stress that again, because if the computer is behind a router, it will use the ip assigned to it by the router, not the external IP the rest of the world sees.