Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-03-21
3
Medium Priority
?
349 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

772 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