473,473 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

WAN IP Address


Does anyone know how to obtain the WAN/Public IP Address (not LAN) using
VB .NET 2005?

I have an existing Service, which I wrote, that cheats by using
System.Net.WebClient to access a Remote Server, but I would now like to
do it "properly" (maybe by interrogating the Router??) but can't seem to
find a way!

Yes, and despite millions of references on Google, it doesn't appear
that anyone has actually provided a solution.

Thank-you in advance for any assistance you are able to provide.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Apr 19 '07 #1
5 3107
I used a web service to do it: You can view the code here:

http://boycot.no-ip.com/vb/GetInetIP.htm
"ShaneO" <sp****@optusnet.com.auwrote in message
news:46**********************@news.optusnet.com.au ...
>
Does anyone know how to obtain the WAN/Public IP Address (not LAN) using
VB .NET 2005?

I have an existing Service, which I wrote, that cheats by using
System.Net.WebClient to access a Remote Server, but I would now like to do
it "properly" (maybe by interrogating the Router??) but can't seem to find
a way!

Yes, and despite millions of references on Google, it doesn't appear that
anyone has actually provided a solution.

Thank-you in advance for any assistance you are able to provide.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.

Apr 19 '07 #2
Terry Olsen wrote:
I used a web service to do it: You can view the code here:

http://boycot.no-ip.com/vb/GetInetIP.htm

Thank-you Terry for your reply. I also use something similar (see
below) and I guess I've now had to resign myself to the fact that it
can't be done any other way from within the Private Network. It's
surprising though, as one would expect that a standard would have been
developed by now to retrieve such information directly from the Router,
oh well, maybe in the future....???

My current method -

Dim WebAccessClient As New System.Net.WebClient
Dim sIP as String =
WebAccessClient.DownloadString("http://www.whatismyip.com/")
WebAccessClient.Dispose()
Dim iFin As Integer
sIP = sIP.ToUpper
Dim iStart As Integer = sIP.IndexOf("YOUR IP IS ")
If iStart 0 Then
iStart += 12
iFin = (sIP.IndexOf("</H1>", iStart)) + 1
sIP = Strings.Mid(sIP, iStart, iFin - iStart)
End If
ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Apr 19 '07 #3
ShaneO <sp****@optusnet.com.auwrote in news:4626bdc3$0$5743$afc38c87
@news.optusnet.com.au:
I have an existing Service, which I wrote, that cheats by using
System.Net.WebClient to access a Remote Server, but I would now like to
do it "properly" (maybe by interrogating the Router??) but can't seem to
find a way!
The only way to get it from the router would be through UPNP. But not all
routers implement UPNP properly, so I'm not sure how hard it will be to do.

To make things more complex, not all routers support UPNP and many have it
disabled by default. Thus it's probably easiest to query an external server
:-)
Apr 19 '07 #4
ShaneO <sp****@optusnet.com.auwrote in news:4626d83f$0$28625$afc38c87
@news.optusnet.com.au:
Thank-you Terry for your reply. I also use something similar (see
below) and I guess I've now had to resign myself to the fact that it
can't be done any other way from within the Private Network. It's
surprising though, as one would expect that a standard would have been
developed by now to retrieve such information directly from the Router,
oh well, maybe in the future....???
UPNP, SNMP... there are in fact several standards - but none that are 100%
supported.
Apr 19 '07 #5
Spam Catcher wrote:
ShaneO <sp****@optusnet.com.auwrote in news:4626d83f$0$28625$afc38c87
@news.optusnet.com.au:
>Thank-you Terry for your reply. I also use something similar (see
below) and I guess I've now had to resign myself to the fact that it
can't be done any other way from within the Private Network. It's
surprising though, as one would expect that a standard would have been
developed by now to retrieve such information directly from the Router,
oh well, maybe in the future....???

UPNP, SNMP... there are in fact several standards - but none that are 100%
supported.

Thank-you Spam Catcher,

My use of the term "standard" should have read as "common method" or
"agreed method". I'm certainly aware of the various communication
protocols that are in use, but as you wrote, none of them are of any
good unless everyone agrees on a method to expose the information that
someone might be seeking. Afterall, using WMI I can find out the type
of CPU and how much RAM is fitted in a system located on the other side
of the planet, but I can't interrogate a Router sitting on my desk to
find out my Public IP Address - it seems a bit strange!

Just my opinion.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Apr 19 '07 #6

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

Similar topics

21
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port...
8
by: YAN | last post by:
Hi, I want to get the mac address from a machine, which i have the IP address of that machine, how can i do that? I know how to get the mac address of the local machine from the following code: ...
7
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of...
33
by: baumann.Pan | last post by:
hi all, i want to get the address of buf, which defined as char buf = "abcde"; so can call strsep(address of buf, pointer to token);
4
by: andreas.w.h.k. :-\) | last post by:
How do I change the address location in the wsdl <wsdl:port name="SearchSoap12" binding="tns:SearchSoap12"> <soap12:address location="http://searchservices/engine/search.asmx" /> </wsdl:port> ...
1
by: Phoenix_ver10 | last post by:
I have a mailing list with multiple names going to the same addresses. I need one address with all the names for that address on it. I checked out the example on microsoft's site, but A: It doesn't...
1
by: Jamie J. Begin | last post by:
I'm very new to the world of Python and am trying to wrap my head around it's OOP model. Much of my OOP experience comes from VB.Net, which is very different. Let's say I wanted to create an...
6
by: Nicolas Noakes | last post by:
Hello, I would like to convert to following process to code. Any advice is welcome. I have a hardware device which requires the this procedure to set it's IP address. First create an static...
36
by: Julienne Walker | last post by:
Ignoring implementation details and strictly following the C99 standard in terms of semantics, is there anything fundamentally flawed with describing the use of a (non-inline) function as an...
1
by: saravanatmm | last post by:
I need javascript code for validate the email address. Email address field cannot allowed the capital letters, special characters except '@' symbol. But can allowed the small letters, numeric...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.