Results 1 to 5 of 5

Thread: IP Address

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    8

    Question IP Address

    Anyone have an idea of some code I could use in VB.NET so that I could find my net IP address, not my local one?

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Are you behind a router? Because thats seems to be the only problem, when trying to your IP address. If not, it should be easy. Just search the boards, its been asked about before.
    Dont gain the world and lose your soul

  3. #3
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    this may helps
    To find your IP address we first ask for your machine name, then we pass that to the GetHostName function that gives us a valid IPHostEntry object. This object contains your IP address in the AddressList array, so we just dump the value to the console.

    VB Code:
    1. Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName)_
    2.  Console.WriteLine(CType(h.AddressList.GetValue(0),_  IPAddress).ToString)

    from abstractvb.com

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    8

    Router

    I have router, what do I 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