Results 1 to 4 of 4

Thread: Get IP - quick question *RESOLVED*

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    46

    Get IP - quick question *RESOLVED*

    Hey guys,

    I cant seem to find the syntax in VB.NET to return my local IP address...

    ie:
    VB Code:
    1. label1.Text = 'get my IP here

    Any one know?

    Thanks in advance fpr the help

    Longy
    Last edited by longshot_zero; Nov 20th, 2002 at 01:15 AM.

  2. #2

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    46
    surely there is a way...

  3. #3
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    VB Code:
    1. Dim ipHost As System.Net.IPHostEntry = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName())
    2.  
    3. Dim ip As System.Net.IPAddress() = ipHost.AddressList
    4.  
    5. Label1.Text = ip(0).ToString()
    You can also enumerate the ip array and get all the ip address thats asociated with your machine.

    Hope that helped.
    Last edited by DevGrp; Nov 20th, 2002 at 12:08 AM.
    Dont gain the world and lose your soul

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    46
    thanks man that helps alot...

    although im still VERY confused about the whole sockets thing...

    anyone got a VERY basic example or tutorial?

    Thanks
    longy

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