473,606 Members | 3,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting external IP Address

Hi, im using this code to get a computers IPAddress

Net.Dns.GetHost Entry(Net.Dns.G etHostName()).A ddressList(0)

but that only gets the Lan IPAddress....ho w can i get the internet IP address?
--
-iwdu15
Oct 15 '06 #1
4 2511
sorry about the double post....i got an error the first time i tried to post,
but apparently it went through anyway
--
-iwdu15
Oct 15 '06 #2

"iwdu15" <jmmgoalsteraty ahoodotcomwrote in message
news:FE******** *************** ***********@mic rosoft.com...
sorry about the double post....i got an error the first time i tried to
post,
but apparently it went through anyway

No worries. Can't specifically answer your question, because the problem is,
it depends how you connect.
If you go through any kind of router/nat setup, the external address is
effectively unknown to your PC. It sends requests to it's default gateway
which then processes them. There are lots of websites out there (such as
www.whatsmyip.net) that can pick up the external address, so maybe you need
to look at somehow sending a request to one of these and processing it?
Oct 16 '06 #3
yea...i saw alot of things on that after doing a google search....i was
wondering, would connecting a socket to the same computer then checking the
remote end point work? i just want to avoid using any websites incase they
are unavailable for some reason....
--
-iwdu15
Oct 16 '06 #4

"iwdu15" <jmmgoalsteraty ahoodotcomwrote in message
news:2E******** *************** ***********@mic rosoft.com...
yea...i saw alot of things on that after doing a google search....i was
wondering, would connecting a socket to the same computer then checking
the
remote end point work? i just want to avoid using any websites incase they
are unavailable for some reason....
Do you mean connecting to "yourself"? I don't think so, as it would be
clever enough to realise that it is within the local segment... the gateway
(and beyond) is only accessed when the computer doesn't "know" how to get to
the destination you give it - so anything on the same subnet will connect
"directly" (for want of a better phrase), whereas anything else will go to
the gateway...
Now, I guess you could try pinging a completely random address and not worry
if it's there or not, and see if the reply (from the gateway and whatever
it's gateway is) gives any information as to the external address? I'm not
sure it will, but perhaps worth a go - effectively you need to work out how
to do a traceroute... then it shouldn't matter if the remote site is up or
down.
I don't have code for doing that however, but a google may turn up
something...
James.
Oct 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1992
by: S. van Beek | last post by:
Dear reader, In case an application is ussing an external model library you have to address this external model library in your application. This addressing takes place in a module of the application by opening of a module and activates and than brows to the location of the external library.
2
5428
by: Tim | last post by:
Hi, I was wondering if anyone knows how to get the external IP address (the address beyond the router ) using C# code? Basically this is the address that appears on the internet. Thanks Tim
1
15170
by: Lorne Smith | last post by:
Hi, I'm running a small network and need to get the external IP address of my router so that I can update my DNS forwarding service should my IP change (it's a dynamic one)... I can get the IP addresses of all the machines in the network, and can get the internal IP address of the default gateway (the router), but I need to get the external IP address... Any pointers?
1
357
by: iwdu15 | last post by:
Hi, im trying to get the public IPAddress of a computer programmatically. I tried using Net.DNS.GetHostEntry(Net.Dns.GetHostName()).AddressList(0) but that only gives the inter-network IPAddress. how can i get the external IP Address....if that makes any sense thanks --
4
2639
by: fmaxwell | last post by:
Dear Group I have a very frustrating problem. I have been trying to make it more difficult to access external javascript files by using PHP sessions. This works beautifully locally (both in IE6 and IE7) and online in IE7, but frustratingly, online in IE6, the javascript does not render on the page, unless you refresh the page. Is there something different about the way IE6 handles sessions? Why
1
9448
by: danknauf | last post by:
I have a webserver which is behaving strangely. The server is a fresh copy of Windows 2003 running IIS with default options + Active Server Pages installed. The server is connected to a Linksys router, and has a static IP address of 192.168.1.10. When I access a page with the following script directly from the server, my WAN IP address is returned (24.x.x.x.), instead of my LAN address. <%
8
4158
by: Steven D'Aprano | last post by:
I have a PC behind a firewall, and I'm trying to programmatically determine the IP address visible from outside the firewall. If I do this: '127.0.0.1' ('localhost.localdomain', , ) I get my internal IP address, which is not what I want.
41
3513
by: LayneMitch via WebmasterKB.com | last post by:
I was just chating with a few webdevelopers and it was brought to my attention that I need some type of server technology installed on my computer so I could get a visual of how my sites would look on the web. I'm completely new to the server technology stuff and don't need anything expensive - only for testing purposes and so other web artists can see my work and give me their opinion/suggestions. What is the process of getting...
4
13051
by: remya1000 | last post by:
i'm using VB.NET 2003 Application program. i need to get External IP Address (internet). i searched internet and found come codes and tried that... i tried this code... but it returned my internal IP Address... Dim IPHost As IPHostEntry = Dns.GetHostByName(Dns.GetHostName()) MessageBox.Show("My IP address is " & IPHost.AddressList(0).ToString()) and i tried this code too...
0
8036
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8448
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8126
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8317
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2454
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1313
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.