|
-
Jul 15th, 2004, 10:48 AM
#1
Thread Starter
Hyperactive Member
Automatically Detect IP address of compter? *RESOLVED - Thank You*
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
Last edited by flycast; Jul 16th, 2004 at 10:53 AM.
-
Jul 15th, 2004, 11:15 AM
#2
I wonder how many charact
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
-
Jul 15th, 2004, 11:20 AM
#3
Thread Starter
Hyperactive Member
Thank you!
That works.
I appreciate your help.
Eric
-
Jul 15th, 2004, 11:22 AM
#4
I wonder how many charact
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|