VB: Get IP

Posted on 2006-05-16
Last Modified: 2010-04-17
I am trying to get my ip in visual basic, now i thought this would be a simple task as i am an asp programming coming to visual basic i thought it would only take a couple of lines.

now ive come to find that yes it shows my ip but it shows my network ip (im on a wireless router)  Is there a way to get it to show my actual IP and not my network ip ??

Many Thanks,
Question by:TheJay04
    LVL 32

    Expert Comment

    Confusing question....

    If by "network ip" you mean your local/LAN private IP (something like 192.168.0.X) and by your "actual IP" you mean the IP your router is using to talk to your ISP/internet then the answer is no.  You PC has no knowledge of the IP that the router is using and if the router doesn't reveal it (which it doesn't) you can't find it directly.

    You can, however, use an outside server of some sort to find the IP like:
    LVL 32

    Expert Comment

    To continue, you could use that web site or another similar one to capture your IP address and make it available to your VB program.
    LVL 2

    Accepted Solution

    URLDownloadToFile: Obtain Machine's Public IP Behind Router


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Android App Development

    This course will involve creating widgets, customize list view, grid view, spinners, etc. Creating applications using audio, video, and SQLite database. Ending with publication on Google Play.

    Suggested Solutions

    RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    737 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

    22 Experts available now in Live!

    Get 1:1 Help Now