Solved

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

Posted on 2004-03-21
3
309 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___
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now