Results 1 to 11 of 11

Thread: [Resolved]how to take both IP addresses

  1. #1

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    Resolved [Resolved]how to take both IP addresses

    i want to get internet ip address when i m sitting on server of a LAN...
    winsock1.localip gives me just LOCAL i.1p like 192.168.0.1
    i want to get both this one ant Internet Ip as well from vb code.. thx :mike:
    Last edited by vbPoet; Feb 22nd, 2005 at 03:59 PM.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: how to take both IP addresses

    well when you are behind a router your computer can't tell that there is a wan IP address... so I don't know how you would be able to get this information via code. If someone has an answer I would like to see it as well, because as far as I know it isn't possible

  3. #3
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: how to take both IP addresses

    Quote Originally Posted by kleinma
    well when you are behind a router your computer can't tell that there is a wan IP address... so I don't know how you would be able to get this information via code. If someone has an answer I would like to see it as well, because as far as I know it isn't possible
    yea i've been looking into it, the only way i can think of doing it (i cnat find an api either) is going to a page such as www.whatismyip.com and looking there (i'm not sure about code)

    I'll see what i cna find though because it is an interesting point

  4. #4
    New Member
    Join Date
    May 2004
    Location
    Greece
    Posts
    11

    Re: how to take both IP addresses

    This page is just a SSI script.
    Probably this one:
    Code:
    <!--#echo var="REMOTE_ADDR" -->
    I believe you could make a prog that grubs the info from this page.
    I don’t think there’s a way of knowing the IP that is given to you by your isp cuz it comes till your router.
    In other words it doesn’t reach your PC…

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: how to take both IP addresses

    Quote Originally Posted by Pino
    yea i've been looking into it, the only way i can think of doing it (i cnat find an api either) is going to a page such as www.whatismyip.com and looking there (i'm not sure about code)

    I'll see what i cna find though because it is an interesting point
    Haven't tested this :

    VB Code:
    1. Dim strName As String
    2.  
    3. Private Sub Form_Load()
    4. txtUrl.Text = "http://checkip.dyndns.org/"
    5. txtIP = (Inet1.OpenURL(txtUrl.Text))
    6. strName = Replace(txtIP, "<html><head><title>Current IP Check</title></head><body>Current IP Address: ", "")
    7. strName = Replace(strName, "</body></html>", "")
    8. txtIP.Text = strName
    9. End Sub


    Has someone helped you? Then you can Rate their helpful post.

  6. #6
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: how to take both IP addresses

    Quote Originally Posted by manavo11
    Haven't tested this :

    VB Code:
    1. Dim strName As String
    2.  
    3. Private Sub Form_Load()
    4. txtUrl.Text = "http://checkip.dyndns.org/"
    5. txtIP = (Inet1.OpenURL(txtUrl.Text))
    6. strName = Replace(txtIP, "<html><head><title>Current IP Check</title></head><body>Current IP Address: ", "")
    7. strName = Replace(strName, "</body></html>", "")
    8. txtIP.Text = strName
    9. End Sub
    Thats what i was thinking a way to parse the HTML, but couldnt think how to do it

    Pino

  7. #7
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: how to take both IP addresses

    yea its impossible to get the external ip unfortunatly without using something on the "outside" to comunicate with

    i used to use a free hosting site brinkster.com and just returned the clients ip in an asp page there

  8. #8
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: [Resolved]how to take both IP addresses



    Has someone helped you? Then you can Rate their helpful post.

  9. #9
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [Resolved]how to take both IP addresses

    Quote Originally Posted by manavo11
    its still an "outside" source though...

    have a page at http://vbnet.mvps.org/resources/tools/getpublicip.shtml that can be used by anyone to return their public IP address

  10. #10
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: [Resolved]how to take both IP addresses

    Quote Originally Posted by kleinma
    its still an "outside" source though...
    I know... It seems impossible to avoid...


    Has someone helped you? Then you can Rate their helpful post.

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: [Resolved]how to take both IP addresses

    Because it IS impossible to DO.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width