Solved

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

Posted on 2004-03-21
3
317 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Paint/Redraw window while dragging 16 86
Windows 10 start screen issues 9 61
Run code from text file in vb 1 85
VB6 - Convert HH:MM into Decimal 8 70
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

740 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