Results 1 to 7 of 7

Thread: IP Address

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    5

    Question

    I'm currently working on a program to communicate across the internet, but in order to do so, I need to be able to detect my IP address. As I am on a LAN, when I try to do this, it returns my LAN IP, whereas I need to get my internet IP. Is there a way to do this?

    Thanks in advance,

    Az.

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Place the winsock control on thr form and a label then add this code.
    Code:
    Label1.Caption = Winsock1.LocalIP
    Hope that helps,
    D!m
    Dim

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    5
    I'm currently using the winsock control to communicate, and unfortunately, when you use the localip property, it returns the IP from the LAN, rather than your internet connection.

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You have to start the winsock control after you are connected to the internet to get the Internet IP I think.
    I was trying to get the same info and that was the easiest way I found, definately not the best though.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    5
    Unfortunately not, I have started the program many times after connecting to the internet, but with no luck.

  6. #6
    New Member
    Join Date
    Sep 2000
    Posts
    1

    Smile hope it helps

    While searching for the answer to the same problem, I came across a link to the following msn knowledge base page:
    http://support.microsoft.com/support.../q160/2/15.asp
    It has a loop in it to account for multi-homed addresses.

    Dip

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    5

    Smile

    Thanks, Dip, that code did exactly what I was looking for.

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