Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 118,659 VB.NET Programmers for FREE! Ask your question and get quick answers from experts. There are 861 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



IP Address

 
Reply to this topicStart new topic

IP Address, Needing to find the IP Address using VB.NET

Galaxy_Stranger
post 16 Nov, 2006 - 11:45 PM
Post #1


New D.I.C Head

*
Joined: 7 Feb, 2006
Posts: 18


My Contributions


Hi.

I'm writing a little application that passes strings to another executable at the command line. One of the things I need to do is find out what the current IP address is of the machine AND the outside IP Address that has been assigned to the user's router.

Are there any functions for this or is there another way to go about it?

I'm also not above writing a C++ app that gets the information, but I don't know how to get the IP with C++ either!

Thanks in advance.
User is offlineProfile CardPM

Go to the top of the page


the_hangman
post 17 Nov, 2006 - 08:52 AM
Post #2


D.I.C Addict

Group Icon
Joined: 18 Jan, 2006
Posts: 593



Thanked 1 times

Dream Kudos: 200
My Contributions


CODE
TextBox1.Text = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName).AddressList(0).ToString()
should give you the machine IP

I haven't tried to get the router IP yet. If you figure it out let me know and vice versa

This post has been edited by the_hangman: 17 Nov, 2006 - 08:53 AM
User is offlineProfile CardPM

Go to the top of the page

realwish
post 30 Jun, 2008 - 04:52 AM
Post #3


New D.I.C Head

Group Icon
Joined: 29 Jan, 2008
Posts: 43



Dream Kudos: 25
My Contributions


QUOTE(the_hangman @ 17 Nov, 2006 - 08:52 AM) *

CODE
TextBox1.Text = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName).AddressList(0).ToString()
should give you the machine IP

I haven't tried to get the router IP yet. If you figure it out let me know and vice versa

it is giving error on variable not defined
User is offlineProfile CardPM

Go to the top of the page

sam_benne
post 30 Jun, 2008 - 06:13 AM
Post #4


D.I.C Head

Group Icon
Joined: 16 Jan, 2008
Posts: 245



Dream Kudos: 400
My Contributions


is it for vb.net the code or is it for vb6?
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/12/08 04:02AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month