Solved

How can I save my WAN IP to a text file.

Posted on 2004-03-21
3
315 Views
Last Modified: 2008-03-06
Hi can some one help me with saving my WAN IP to a text file.
I am using a router so not even sure how VB is going to obtain the WAN IP.

Or even if your aware of the source code for this or some thing similar I would appreciate any help.
0
Comment
Question by:pnorris99
3 Comments
 
LVL 6

Expert Comment

by:___XXX_X_XXX___
ID: 10643561
Connect to some www address that returns to you your IP address in HTML format.
Possible address is http://checkip.dyndns.org/index.html
Look at:

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20925882.html
for more info
0
 
LVL 14

Accepted Solution

by:
aelatik earned 500 total points
ID: 10643667
Private Sub Form_Load()
    Dim IE, RET, POS1, POS2
    Set IE = CreateObject("internetexplorer.application")
        IE.navigate "http://www.whatismyip.com"
        While IE.busy: DoEvents: Wend
        RET = IE.document.Title
        IE.Quit
    Set IE = Nothing
    POS1 = InStr(1, RET, "is", vbTextCompare) + 3
    POS2 = InStr(1, RET, "what", vbTextCompare)
    Open "c:\wanip.txt" For Output As #1
        Print #1, Mid(RET, POS1, POS2 - (POS1 + 1))
    Close #1
End Sub
0
 
LVL 1

Author Comment

by:pnorris99
ID: 10643892
Thanks for that, I have intergated it into some FTP source code I found, I dont have a static IP address so this will help me keep the links to my IIS webserver upto date.

Many Thankx
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question