CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 1999
    Location
    Holland
    Posts
    34

    IP address to host-name

    Hi, I'm developing a application that takes a host-name and converts that address to IP-address. Does anybody know how I can do this. Thanks.


  2. #2
    Join Date
    Sep 1999
    Location
    Germany
    Posts
    66

    Re: IP address to host-name

    If you know name of PC then you must modify GetIPHostName() function from
    http://www.vbsquare.com/howto/getip.htm

    Public Function GetIPHostName(sHostName$) As String

    If Not SocketsInitialize() Then
    GetIPHostName = ""
    Exit Function
    End If

    GetIPHostName = Left$(sHostName, InStr(sHostName, Chr(0)) - 1)
    SocketsCleanup

    End Function

    And call:

    MsgBox "IP is " & GetIPHostName(Name_your_other_PC)


    [email protected]
    http://smalig.tripod.com

  3. #3

    Re: IP address to host-name


  4. #4
    Join Date
    Oct 1999
    Location
    Holland
    Posts
    34

    Re: IP address to host-name

    Thanks, by the way, good looking site...


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

Featured