Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: FuZe on September 18, 2003, 05:09 PM

Title: Getting my own IPAddress
Post by: FuZe on September 18, 2003, 05:09 PM
Language: VB6

How would I obtain my real IP address that my isp gives me.  I can only get my fake lan ip address, but i'm not sure how to get the real one.  Thx
Title: Re:Getting my own IPAddress
Post by: Banana fanna fo fanna on September 18, 2003, 05:43 PM
Will need to contact a third party server. I suggest connecting via CHAT to battle.net and it will give you your IP address.
Title: Re:Getting my own IPAddress
Post by: iago on September 18, 2003, 05:55 PM
I'm sure there's an easier way than that.
Title: Re:Getting my own IPAddress
Post by: Grok on September 18, 2003, 06:36 PM
Since you're using Visual Basic, I will assume you mean using some edition of Microsoft Windows.

The IP is bound to a network interface.  Using the WIN32 API, you can enumerate network adapters.  Each enumeration returns a structure containing information.  This is enough help to get you started.

Let us know what you come up with!
Title: Re:Getting my own IPAddress
Post by: Camel on September 18, 2003, 06:56 PM
Grok, that wont even begin to help him unless he is connected directly to a WAN interface, which I sincerely doubt based on his post.
Title: Re:Getting my own IPAddress
Post by: drivehappy on September 18, 2003, 08:51 PM
Quote from: FuZe- on September 18, 2003, 05:09 PM
Language: VB6

How would I obtain my real IP address that my isp gives me.  I can only get my fake lan ip address, but i'm not sure how to get the real one.  Thx

The easiest way would be to find a site that determines your external IP address. Use the INET OCX to download the page and parse the IP out of the data.
Title: Re:Getting my own IPAddress
Post by: iago on September 18, 2003, 09:07 PM
My ISP used to make me use a proxy for port 80, so it would be wrong.

Good site is www.network-tools.com
Title: Re:Getting my own IPAddress
Post by: CupHead on September 18, 2003, 10:28 PM
The class I wrote to do this connected to http://www.whatismyip.com (http://www.whatismyip.com) and parsed the HTML to find the IP.  Even enumerating the local IP addresses won't give you the WAN address if you're behind a router or two.
Title: Re:Getting my own IPAddress
Post by: Banana fanna fo fanna on September 19, 2003, 05:53 AM
what the fuck, why do people ignore my posts all the time?
Title: Re:Getting my own IPAddress
Post by: j0k3r on September 19, 2003, 06:25 AM
Quote from: FuZe- on September 18, 2003, 05:09 PM
Language: VB6

How would I obtain my real IP address that my isp gives me.  I can only get my fake lan ip address, but i'm not sure how to get the real one.  Thx
I think if you go to 'Local Area Network' in the D2 login page, it will give you your correct IP... If not then Storm had a good idea. I'm not sure how accurate it is though because I can't even host games on war3 due to my firewall/router.

Storm -- maybe he tried it and it didn't work so instead of flaming you he said nothing... or maybe he hasn't checked the forum again... who knows.
Title: Re:Getting my own IPAddress
Post by: Adron on September 19, 2003, 07:18 AM
Quote from: St0rm.iD on September 19, 2003, 05:53 AM
what the fuck, why do people ignore my posts all the time?

Probably because Grok posted after you and bears much authority and hardly ever makes a mistake, so when he now might have made one, everyone jumped at the chance to bash him.
Title: Re:Getting my own IPAddress
Post by: Grok on September 19, 2003, 10:29 AM
Quote from: Adron on September 19, 2003, 07:18 AM
Quote from: St0rm.iD on September 19, 2003, 05:53 AM
what the fuck, why do people ignore my posts all the time?

Probably because Grok posted after you and bears much authority and hardly ever makes a mistake, so when he now might have made one, everyone jumped at the chance to bash him.

St0rm, heh, it's been observed dozens of times that people ignore your completely legitimate and workable solutions.

Adron, I make plenty of mistakes.  But you're correct, there are a number of insecure people here who are more comfortable being critics than being creators.  Rather than come up with solutions themselves, and let other people criticize them, they bash people who are trying to offer help.  Camel is a primary example of such a person.
Title: Re:Getting my own IPAddress
Post by: Camel on September 19, 2003, 03:29 PM
Quote from: Grok on September 19, 2003, 10:29 AMAdron, I make plenty of mistakes.  But you're correct, there are a number of insecure people here who are more comfortable being critics than being creators.  Rather than come up with solutions themselves, and let other people criticize them, they bash people who are trying to offer help.  Camel is a primary example of such a person.
Interesting view. My intent, however, was to save him some agony.
[edit] I didn't give an answer because St0rm already did.
Title: Re:Getting my own IPAddress
Post by: DarkVirus on September 20, 2003, 07:42 PM
I guess I'm confused... Are you looking for some type of code to write in VB 6.0 or VB .Net to reveal your real IP or are you just trying to generally find your ISP given IP...  

Also are you behind a router of some sort or are you hooked directly to the net via modem. If that's the case there are multiple ways of finding your IP given to you by your ISP... If your looking for your LAN IP then I suggest the normal methods either in code using winsock or dsSocket32 or you could just go to Command Prompt or DOS and type  ipconfig /all  

If you are looking for your ISP given IP then I suggest looking at your router settings... If you don't have access to that type of information (assuming your even behind a router) then I can't help you in terms of coding because I'm not at my computer but on my g/f's comp.

So again, what exactly are you trying to do in terms of the questions asked above?
Title: Re:Getting my own IPAddress
Post by: iago on September 21, 2003, 06:29 AM
Quote from: DarkVirus on September 20, 2003, 07:42 PM
I guess I'm confused... Are you looking for some type of code to write in VB 6.0 or VB .Net to reveal your real IP or are you just trying to generally find your ISP given IP...  

Also are you behind a router of some sort or are you hooked directly to the net via modem. If that's the case there are multiple ways of finding your IP given to you by your ISP... If your looking for your LAN IP then I suggest the normal methods either in code using winsock or dsSocket32 or you could just go to Command Prompt or DOS and type  ipconfig /all  

If you are looking for your ISP given IP then I suggest looking at your router settings... If you don't have access to that type of information (assuming your even behind a router) then I can't help you in terms of coding because I'm not at my computer but on my g/f's comp.

So again, what exactly are you trying to do in terms of the questions asked above?

He's using vb6, so ipconfig /all wouldn't be too useful, unless he parses the information from there (I don't know how to use a shell like that, though).   I get the impression that he isn't behind a router, but that he has multiple network connections.  

It might be useful to ask, what type of internet connection do you have?  If it's DSL, it's harder since there's a LAN connection to your modem, then another connection from the modem to the internet.
Title: Re:Getting my own IPAddress
Post by: Banana fanna fo fanna on September 21, 2003, 09:38 AM
...or you could do what I said, which takes, oh, maybe thirty seconds to implement?
Title: Re:Getting my own IPAddress
Post by: iago on September 21, 2003, 06:07 PM
That involves depending on a third-party server, though, which isn't always a good idea.  Although, you can list several battle.net servers so if one is down, or you're banned from one, you can just switch.
Title: Re:Getting my own IPAddress
Post by: FuZe on September 21, 2003, 06:44 PM
Thanks guys for the help
Title: Re:Getting my own IPAddress
Post by: DarkExperts on September 29, 2003, 05:18 PM
to obtain ur ip address go to start>run and type in
"winipcfg"  with out the " though ur system ip configuration should come up
Title: Re:Getting my own IPAddress
Post by: K on September 29, 2003, 05:25 PM
Quote from: DarkExperts on September 29, 2003, 05:18 PM
to obtain ur ip address go to start>run and type in
"winipcfg"  with out the " though ur system ip configuration should come up

Except....
1) this will only work on win9x, not NT/2k/XP.
2) this will not give you your external IP address.
3) this is not a programmatic solution.
Title: Re:Getting my own IPAddress
Post by: iago on September 29, 2003, 05:38 PM
Quote from: K on September 29, 2003, 05:25 PM
Quote from: DarkExperts on September 29, 2003, 05:18 PM
to obtain ur ip address go to start>run and type in
"winipcfg"  with out the " though ur system ip configuration should come up
1) this will only work on win9x, not NT/2k/XP.

Can you ipconfig for that :)
Title: Re:Getting my own IPAddress
Post by: Seven on October 16, 2003, 07:03 AM
Doesn't ICQ give the real IP?
Title: Re:Getting my own IPAddress
Post by: Yoni on October 16, 2003, 07:08 AM
Quote from: Seven on October 16, 2003, 07:03 AM
Doesn't ICQ give the real IP?
That's a terribly unreliable way of getting it.
Title: Re:Getting my own IPAddress
Post by: Banana fanna fo fanna on October 16, 2003, 05:46 PM
Or you could do what I said.
Title: Re:Getting my own IPAddress
Post by: -Death- on October 16, 2003, 09:15 PM
http://www.ThugProductions.net/

Go to the Downloads section.
All you need. It is freaken awsome.

:) ;) :D ;D >:( :( :o 8) ??? ::) :P :-[ :-X :-\ :-:-* :'(
Title: Re:Getting my own IPAddress
Post by: CrAz3D on October 17, 2003, 10:53 PM
Add a winsock control then winsock1.LocalIP
Title: Re:Getting my own IPAddress
Post by: Fr0z3N on October 18, 2003, 09:43 AM
that wouldn't get your real ip for example if your on a router.
Title: Re:Getting my own IPAddress
Post by: Kp on October 18, 2003, 10:02 AM
Quote from: Fr0z3N on October 18, 2003, 09:43 AMthat wouldn't get your real ip for example if your on a router.
Of course it would get your real [internal] IP.  The problem is he wants his external IP address, which is known only by the NAT device and other things outside it.
Title: Re:Getting my own IPAddress
Post by: Banana fanna fo fanna on October 19, 2003, 07:51 PM
Or you could so what I said.
Title: Re:Getting my own IPAddress
Post by: iago on October 19, 2003, 08:31 PM
Quote from: St0rm.iD on October 19, 2003, 07:51 PM
Or you could so what I said.

Perhaps he wants a variety of options?
Title: Re:Getting my own IPAddress
Post by: Adron on October 20, 2003, 05:50 AM
Why do people keep posting suggestions for getting the local IP?
Title: Re:Getting my own IPAddress
Post by: Hitmen on October 20, 2003, 03:48 PM
Because they don't know the difference?