Results 1 to 3 of 3

Thread: Get my local IP

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    Pennsylvania
    Posts
    133

    Get my local IP

    How do I get my local IP in vb.net?

    As a followup questions how would I connect to a remote computer like we could with the winsock control in VB.

    I know I can use the winsock control, but I wanted to use the .Net framework.

  2. #2
    Member
    Join Date
    Jun 2002
    Posts
    52
    To get your local IP use:

    Dim myIP As IPHostEntry = System.Net.Dns.Resolve(System.Net.Dns.GetHostName())

    Then you can use for example:
    label1.text = "My ip = " & myIP.AddressList(0).ToString

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    and here is a .net chat example not using winsock

    http://msdn.microsoft.com/library/de...et08282001.asp
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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